# NOT RUN {
##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (R, A, Subj, P, Obj)
{
if (length(Subj) != length(Obj)) {
stop("rescal_SO_Val: List of subjects and objects must be of the same length")
}
val = rowSums((A[Subj, , drop = FALSE] %*% R[[P]]) * (A[Obj,
, drop = FALSE]))
return(data.frame(Subj, P, Obj, val))
}
# }
Run the code above in your browser using DataLab