getTnsrijk: tensor frontal slices to indices

Description Usage Arguments Value Author(s) See Also Examples

View source: R/RDF2Tensor.R

Description

convert tensor frontal slices to indices with three columns (i.e i ,j , k)

Usage

1

Arguments

X

LIST of sparce matrices, with each entry representing one predicate.

Value

a matrix of three columns representing indices of 1 values in the tensor

Author(s)

Abdelmoneim Amer Desouki

See Also

tnsr2trp getTensor

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
trp=rbind(
    cbind('Alex',  'loves', 'Don'),
    cbind('Alex',  'loves', 'Elly'),
    cbind('Alex',  'hates', 'Bob'),
    cbind('Don',   'loves', 'Alex'),
    cbind('Don',   'hates', 'Chris'),
    cbind('Chris', 'hates', 'Bob'),
    cbind('Bob',   'hates', 'Chris'),
    cbind('Elly',  'hates', 'Chris'),
    cbind('Elly',  'hates', 'Bob'),
    cbind('Elly',  'loves', 'Alex')
    )
######
# form tensor as a set of frontal slices (Predicate mode)
    tnsr=getTensor(trp)
    subs=getTnsrijk(tnsr$X)
    print(subs)

RDFTensor documentation built on Jan. 16, 2021, 5:19 p.m.