convertJudgePresenterMatrix {raincin} | R Documentation |
Convert a judge-presenter matrix to a data frame with three variables/columns
convertJudgePresenterMatrix(jpMat)
jpMat |
a Judge-Presenter matrix, or a User-Movie matrix |
score
: nonzero and non-NA scores
row
: array indices
col
: arry indices
A data frame as a long table, where each row is an observation, including the score, the row number and the column number in the jpMat
matrix
Jiangtao Gou
Fengqing Zhang
jpMat <- matrix(data=c(5,4,3,0, 5,5,3,1, 0,0,0,5, 0,0,2,0, 4,0,0,3, 1,0,0,4),
nrow=6,
byrow=TRUE)
result <- convertJudgePresenterMatrix(jpMat)
print(result)