Hello! Is it possible to continue expand one command on several lines in R ? An attempt to write a=c(1990," ",1991, 1992, 1993,1994,1995,1996,1997,1998, 1999) in a file and then source('file') results in Error in parse(file, n, text, prompt) : syntax error on line 55 Thanks. Nick -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Nick Kostrov <nikolai at eri.u-tokyo.ac.jp> writes:> Hello! > > Is it possible to continue expand one command on several lines in R ? > > An attempt to write > > a=c(1990," ",1991, > 1992, > 1993,1994,1995,1996,1997,1998, > 1999) > > in a file and then > > source('file') > > results in > > Error in parse(file, n, text, prompt) : syntax error on line 55Shouldn't be a problem if you just make sure that the preceding line is incomplete, but if that "=" was meant as an assignment, then you'll get the parse error even on one line. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
The problem with this is the use of the equals sign, not continuing over more than one line. It should be a <- c(1990," ",1991,...) David ----- Original Message ----- From: "Nick Kostrov" <nikolai at eri.u-tokyo.ac.jp> To: <r-help at stat.math.ethz.ch> Sent: Wednesday, December 05, 2001 2:30 PM Subject: [R] one command on several lines> Hello! > > Is it possible to continue expand one command on several lines in R ? > > An attempt to write > > a=c(1990," ",1991, > 1992, > 1993,1994,1995,1996,1997,1998, > 1999) > > in a file and then > > source('file') > > results in > > Error in parse(file, n, text, prompt) : syntax error on line 55 > > > > Thanks. > > Nick > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-> r-help mailing list -- Readhttp://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html> Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch >_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._. _._> >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Nick Kostrov <nikolai at eri.u-tokyo.ac.jp> writes:>Hello! > >Is it possible to continue expand one command on several lines in R ? > >An attempt to write > >a=c(1990," ",1991, > 1992, > 1993,1994,1995,1996,1997,1998, > 1999) > >in a file and then > >source('file') > >results in > >Error in parse(file, n, text, prompt) : syntax error on line 55 >'=' is used to give a function parameter a value when calling a function, You want '<-'. Mark -- Mark Myatt -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._