Hello there, I want to create a string from strings and numbers, here is my code: str <- "name" & toString(20) but it returns me this error: Error in toString(20) : could not find function ".jcall" what did I do wrong? I couldn't find this error anywhere... -- View this message in context: http://n4.nabble.com/Error-with-toString-tp1290327p1290327.html Sent from the R help mailing list archive at Nabble.com.
?paste "&" is a logical operator, not string concatenation. On Tue, Jan 26, 2010 at 9:09 AM, anna <lippelanna24 at hotmail.com> wrote:> > Hello there, I want to create a string from strings and numbers, here is my > code: > str <- "name" & toString(20) > but it returns me this error: > Error in toString(20) : could not find function ".jcall" > what did I do wrong? I couldn't find this error anywhere... > -- > View this message in context: http://n4.nabble.com/Error-with-toString-tp1290327p1290327.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. >-- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve?
On 01/26/2010 03:09 PM, anna wrote:> Hello there, I want to create a string from strings and numbers, here is my > code: > str<- "name"& toString(20)Where did you get that syntax from ? You need to use paste. > paste( "name", 20 ) [1] "name 20"> but it returns me this error: > Error in toString(20) : could not find function ".jcall" > what did I do wrong? I couldn't find this error anywhere....jcall is in rJava, but rJava never calls toString. Can you attach a bit more information as requested by the posting guide : http://www.r-project.org/posting-guide.html Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/KfKn : Rcpp 0.7.2 |- http://tr.im/JOlc : External pointers with Rcpp `- http://tr.im/JFqa : R Journal, Volume 1/2, December 2009
"name" & toString(20) is from Excel or OpenOffice; & means 'logical and' in R, not string concatenation. paste() is simpler; sprintf() is more precise as to decimal places and format.>>> anna <lippelanna24 at hotmail.com> 26/01/2010 14:09:15 >>>Hello there, I want to create a string from strings and numbers, here is my code: str <- "name" & toString(20) but it returns me this error: Error in toString(20) : could not find function ".jcall" what did I do wrong? I couldn't find this error anywhere... -- ******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}}