[prev in list] [next in list] [prev in thread] [next in thread]
List: r-help
Subject: Re: [R] lsa-cosine subscript out of bounds error
From: S Ellison <S.Ellison () lgcgroup ! com>
Date: 2016-10-28 13:20:17
Message-ID: 1A8C1289955EF649A09086A153E26724040099681F () GBTEDVPEXCMB04 ! corp ! lgc-group ! com
[Download RAW message or body]
> 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.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic