我正在尝试将矩阵更改为可以在推荐实验室包的功能中使用的结构。
datafile1 <- as(datafile1,"matrix")
datafile1
name1 name2 rating1 rating2 rating3 rating4 rating5 rating6
[1,] "1" "a" "0" "0" "1" "0" "0" "0"
[2,] "2" "d" "0" "0" "1" "0" "0" "0"
[3,] "3" "x" "1" "0" "1" "0" "0" "0"
[4,] "4" "b" "0" "1" "1" "0" "0" "0"
library(recommenderlab)
datafile1 <- as(datafile1, "realRatingMatrix")
这是结果:
asMethod(object) 中的错误:dup_mMatrix_as_geMatrix 的类“NA”无效
有谁知道这里出了什么问题?