Hi, I have a basic import problem. I tried to import a comma delimited "boston.csv" from C drive and gave the following command at R prompt>read.csv(c:\boston.csv,sep=",",dec=".",fill=TRUE)Error: syntax error can any one help to debugg the code.I am using R version 1.3 for windows with regards srinivas __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Try>read.csv("c:/boston.csv", sep=".",dec=".", fill=TRUE)On Sun, 26 Aug 2001, srinivasa raghavan wrote:> Hi, > > I have a basic import problem. I tried to import a > comma delimited "boston.csv" from C drive and gave the > following command at R prompt > > >read.csv(c:\boston.csv,sep=",",dec=".",fill=TRUE) > Error: syntax error > > can any one help to debugg the code.I am using R > version 1.3 for windows > > with regards > > srinivas > > > __________________________________________________ > Do You Yahoo!? > Make international calls for as low as $.04/minute with Yahoo! Messenger > http://phonecard.yahoo.com/ > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > 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 > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>>>>> "srinivas" == srinivasa raghavan <sristatistician at yahoo.com> writes:srinivas> Hi, I have a basic import problem. I tried to import a comma srinivas> delimited "boston.csv" from C drive and gave the following srinivas> command at R prompt >> read.csv(c:\boston.csv,sep=",",dec=".",fill=TRUE) srinivas> Error: syntax error srinivas> can any one help to debugg the code.I am using R version 1.3 srinivas> for windows The syntax error is because you didn't quote the file name, and ":" , "\" will give problems. But even with quotes that wouldn't work directly: Note that "\" is the escape character (used, e.g. in "\n" which is newline) and hence would have to be doubled. The `real' recommendation otoh is to use real slashes instead of windoze ones : read.csv("c:/boston.csv", sep=",", dec=".", fill=TRUE) ^ Martin Maechler <maechler at stat.math.ethz.ch> http://stat.ethz.ch/~maechler/ Seminar fuer Statistik, ETH-Zentrum LEO D10 Leonhardstr. 27 ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND phone: x-41-1-632-3408 fax: ...-1228 <>< -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Sun, 26 Aug 2001, srinivasa raghavan wrote:> Hi, > > I have a basic import problem. I tried to import a > comma delimited "boston.csv" from C drive and gave the > following command at R prompt > > >read.csv(c:\boston.csv,sep=",",dec=".",fill=TRUE) > Error: syntax error > > can any one help to debugg the code.I am using R > version 1.3 for windows(1.3.0 probably.) You need to 1) quote character strings 2) use \\ for \. E.g. read.csv("c:\\boston.csv",sep=",",dec=".",fill=TRUE) and as all the other arguments are the defaults, just read.csv("c:\\boston.csv") is equivalent.> > with regards > > srinivas > > > __________________________________________________ > Do You Yahoo!? > Make international calls for as low as $.04/minute with Yahoo! Messenger > http://phonecard.yahoo.com/ > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > 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 > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> -----Original Message----- > From: srinivasa raghavan [mailto:sristatistician at yahoo.com] > Sent: 27. august 2001 08:26 > To: r-help at stat.math.ethz.ch > Subject: [R] Importing file from Excel > > > Hi, > > I have a basic import problem. I tried to import a > comma delimited "boston.csv" from C drive and gave the > following command at R prompt > > >read.csv(c:\boston.csv,sep=",",dec=".",fill=TRUE) > Error: syntax errorYou need read.csv("c:/boston.csv",sep=",",dec=".",fill=TRUE) Best wishes, Bendix ---------------------- Bendix Carstensen Senior Statistician Steno Diabetes Centre Niels Steensens Vej 2 DK-2820 Gentofte Denmark tel: +45 44 43 87 38 mob: +45 28 25 87 38 fax: +45 44 43 73 13 bxc at novo.dk www.biostat.ku.dk/~bxc ---------------------- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>Hi,> I have a basic import problem. I tried to import a >comma delimited "boston.csv" from C drive and gave the >following command at R prompt>>read.csv(c:\boston.csv,sep=",",dec=".",fill=TRUE)Error: syntax error>can any one help to debugg the code.I am using R >version 1.3 for windowsYou should use:>read.csv("c:/boston.csv")Best regards, Philippe Grosjean ...........]<(({?<...............<?}))><............................... ) ) ) ) ) __ __ ( ( ( ( ( |__) | _ ) ) ) ) ) | hilippe |__)rosjean ( ( ( ( ( Marine Biol. Lab., ULB, Belgium ) ) ) ) ) __ ( ( ( ( ( |\ /| |__) ) ) ) ) ) | \/ |ariculture & |__)iostatistics ( ( ( ( ( ) ) ) ) ) e-mail: phgrosje at ulb.ac.be or phgrosjean at sciviews.org ( ( ( ( ( SciViews project coordinator (http://www.sciviews.org) ) ) ) ) ) tel: 00-32-2-650.29.70 (lab), 00-32-2-673.31.33 (home) ( ( ( ( ( ) ) ) ) ) "I'm 100% confident that p is between 0 and 1" ( ( ( ( ( L. Gonick & W. Smith (1993) ) ) ) ) ) ...................................................................... -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._