An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110818/534e3b64/attachment.pl>
convert a matrix to binaryMatrix in Recommenderlab
2 messages · Jing Xi, Michael Hahsler
11 days later
Hi Jing recommenderlab is still under heavy development and quite far away from version 1.0-0. Here is some code to create a binaryRatingMatrix from a 0-1 matrix: library(recommenderlab) ## create a 10x10 0-1 matrix m <- matrix(sample(c(0,1),100, replace=TRUE), nrow=10, ncol=10) m ## coerce it into a binaryRatingMatrix b <- as(m, "binaryRatingMatrix") b ## coerce it back to see if it worked as(b, "matrix") Hope this helps, -Michael
Dr. Michael Hahsler, Visiting Assistant Professor Department of Computer Science and Engineering Lyle School of Engineering Southern Methodist University, Dallas, Texas (214) 768-8878 * mhahsler at lyle.smu.edu * http://lyle.smu.edu/~mhahsler