An embedded and charset-unspecified text was scrubbed... Name: no disponible URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120223/2351466a/attachment.pl>
Problems with Cosine Similarity using library(lsa)
7 messages · Uwe Ligges, A J, Dallas
The error message suggests that you do not have Java installed. And since you said it works in 32-bit: You only have a 32-bit Java but no 64-bit Java installed in your machine. Uwe Ligges
On 23.02.2012 11:08, A J wrote:
Hi everybody!
I have intended to use library(lsa) on R 64-bits for Windows but it was not possible. Every time I try to launch library(lsa) function R give me back next message:
Loading required package: SnowballError : .onLoad failed in loadNamespace() for 'Snowball', details: call: NULL error: .onLoad failed in loadNamespace() for 'rJava', details: call: stop("No CurrentVersion entry in '", key, "'! Try re-installing Java and make sure R and Java have matching architectures.") error: objeto 'key' no encontradoError: package ?Snowball? could not be loaded
Of course, I have loaded all necessary packages, but the only way to library(lsa) works it is on R 32-bits release. The problem here is that R don't leave me to load all data from my matrix and tell me that it is not able to load big vectors (may be due to limitations on memory of 32-bit release).
The issue is that I need to calculate cosine similarities on my matrix data. Has somebody any suggestion or idea about how to do it (a different library or a formula to get it)?
Thanks in advance.
Best,
AJ
[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list 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.
An embedded and charset-unspecified text was scrubbed... Name: no disponible URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120223/e1e932d3/attachment.pl>
On 23.02.2012 13:07, A J wrote:
Thanks Uwe, you vere right. Now the library is working but I have next problem as well. I have loaded a matrix (named matrix_v3) from a TXT file. This matrix was previously reached using xtabs function. Now I have used this formula to obtain cosine similarities from my data matrix (following instructions of lsa package instructions):
cosine(matrix_v3, y = NULL)
Finally R returns this message: Error en cosine(matrix_v3, y = NULL) : argument mismatch. Either one matrix or two vectors needed as input. I understand that R don't contemplate matrix_v3 like a real matrix. If this is like this, how can I do? I have tried "as.matrix" but it does not work. Sorry if my questions are not very fine, but I am newbie in using R.
We do not know what you object matrix_v3 is, so how could we help? PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Thanks again.
Date: Thu, 23 Feb 2012 11:35:04 +0100 From: ligges at statistik.tu-dortmund.de To: anxusgo at hotmail.com CC: r-help at r-project.org Subject: Re: [R] Problems with Cosine Similarity using library(lsa) The error message suggests that you do not have Java installed. And since you said it works in 32-bit: You only have a 32-bit Java but no 64-bit Java installed in your machine. Uwe Ligges On 23.02.2012 11:08, A J wrote:
Hi everybody!
I have intended to use library(lsa) on R 64-bits for Windows but it was not possible. Every time I try to launch library(lsa) function R give me back next message:
Loading required package: SnowballError : .onLoad failed in loadNamespace() for 'Snowball', details: call: NULL error: .onLoad failed in loadNamespace() for 'rJava', details: call: stop("No CurrentVersion entry in '", key, "'! Try re-installing Java and make sure R and Java have matching architectures.") error: objeto 'key' no encontradoError: package ?Snowball? could not be loaded
Of course, I have loaded all necessary packages, but the only way to library(lsa) works it is on R 32-bits release. The problem here is that R don't leave me to load all data from my matrix and tell me that it is not able to load big vectors (may be due to limitations on memory of 32-bit release).
The issue is that I need to calculate cosine similarities on my matrix data. Has somebody any suggestion or idea about how to do it (a different library or a formula to get it)?
Thanks in advance.
Best,
AJ
[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list 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.
An embedded and charset-unspecified text was scrubbed... Name: no disponible URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120223/db0b684e/attachment.pl>
The as.matrix (and as.table or as. vector or as.numeric ...) command takes the object that you wish to convert as an argument. So the code below will actually perform the conversion from table to matrix.
newmatrix<- as.matrix(matrix_v3)
A way to see what form your data are taking is to use the command typeof(object). In this case, you can write
typeof(matrix_v3)
Easy fix (hopefully) Tad -- View this message in context: http://r.789695.n4.nabble.com/Problems-with-Cosine-Similarity-using-library-lsa-tp4413433p4415114.html Sent from the R help mailing list archive at Nabble.com.
An embedded and charset-unspecified text was scrubbed... Name: no disponible URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120224/fd58c3ec/attachment.pl>