> I have created a document term matrix from corpus.I would like to apply > Cosine similarity to find similar documents,when I apply cosine(w.mt) I get " > Error in x[,i] : Subscript out of bounds" > Can anyone let me know how to overcome this error?
Not specifically, from the information you have given. But in general, subscript errors in a function are often caused by the user (you) supplying the wrong object type or an object with incorrect dimensions. So you could start by making sure w.mt is what cosine() expects. class(w.mt) dim(w.mt) str(w.mt) could all help. S Ellison ******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}} ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.