RDFTensor (version 1.3)

getTnsrijk: tensor frontal slices to indices

Description

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

Usage

getTnsrijk(X)

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

See Also

tnsr2trp getTensor

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab