Dear all, Who will bail me out. Iam using R with S-Splancs. Anytime i typed in the syntex, an error will appear eg setwd("C:\\TEMP)>dat <- read.table(cheshire_fmd.cvs",header=TRUE, sep=",") > dat.<-read.table(''chesire_fmd.cvs'',header=TRUE,sep='',)Error: unexpected symbol in "dat.<-read.table(''chesire_fmd.cvs"> dat$x.km <-dat$xcoord/1000Error: object 'dat' not found> dat$y.km <-dat$ycoord/1000Error: object 'dat' not found> dat[1:10,]Error: object 'dat' not found> Library(splancs)I was advised to remove the '>' at begining of each line, but its like that symbol is a default. How do i do that. Thanks El-Oji Adamu Nigeria [[alternative HTML version deleted]]
You left a quotation mark out of your very first statement, and then some others. Quotation marks must be balanced. Try this instead: setwd("C:\\TEMP") dat <- read.table("cheshire_fmd.cvs",header=TRUE, sep=",") dat[1:10,] Sarah On Tue, Mar 20, 2012 at 10:36 AM, adamu eloji <aeloji60 at yahoo.com> wrote:> Dear all, > > ?Who will bail me out. Iam using R with S-Splancs. Anytime i typed in the syntex, an error will appear eg setwd("C:\\TEMP) >>dat <- read.table(cheshire_fmd.cvs",header=TRUE, sep=",") >> dat.<-read.table(''chesire_fmd.cvs'',header=TRUE,sep='',) > Error: unexpected symbol in "dat.<-read.table(''chesire_fmd.cvs" >> dat$x.km <-dat$xcoord/1000 > Error: object 'dat' not found >> dat$y.km <-dat$ycoord/1000 > Error: object 'dat' not found >> dat[1:10,] > Error: object 'dat' not found >> Library(splancs) > I was advised to remove the '>' at begining of each line, but its like that symbol is a default. How do i do that. > Thanks > El-Oji Adamu > Nigeria >-- Sarah Goslee http://www.functionaldiversity.org
You have a syntax error:> dat.<-read.table(''chesire_fmd.cvs'',header=TRUE,sep='',)Error: unexpected symbol in "dat.<-read.table(''chesire_fmd.cvs" notice the sep='', probably should be sep = ',' On Tue, Mar 20, 2012 at 10:36 AM, adamu eloji <aeloji60 at yahoo.com> wrote:> Dear all, > > ?Who will bail me out. Iam using R with S-Splancs. Anytime i typed in the syntex, an error will appear eg setwd("C:\\TEMP) >>dat <- read.table(cheshire_fmd.cvs",header=TRUE, sep=",") >> dat.<-read.table(''chesire_fmd.cvs'',header=TRUE,sep='',) > Error: unexpected symbol in "dat.<-read.table(''chesire_fmd.cvs" >> dat$x.km <-dat$xcoord/1000 > Error: object 'dat' not found >> dat$y.km <-dat$ycoord/1000 > Error: object 'dat' not found >> dat[1:10,] > Error: object 'dat' not found >> Library(splancs) > I was advised to remove the '>' at begining of each line, but its like that symbol is a default. How do i do that. > Thanks > El-Oji Adamu > Nigeria > > ? ? ? ?[[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. >-- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it.
On Mar 20, 2012, at 10:36 AM, adamu eloji wrote:> Dear all, > > Who will bail me out.You seem to be doing homework. This is not a mailing list for homework.> Iam using R with S-Splancs.What is that? You cannot use S packages with R unless someone has ported it.> Anytime i typed in the syntex, an error will appear eg setwd("C:\ > \TEMP) >> dat <- read.table(cheshire_fmd.cvs",header=TRUE, sep=",")Sarah has already shown you the error of the first statement.>> dat.<-read.table(''chesire_fmd.cvs'',header=TRUE,sep='',)That will produce is a different error but it seems to possibly related to you attempting to create double quotes by using two instances of singe-quotes together. That will not succeed. You can match either single quotes or double quotes but you cannot use ''name''.> Error: unexpected symbol in "dat.<-read.table(''chesire_fmd.cvs" >> dat$x.km <-dat$xcoord/1000> Error: object 'dat' not found >> dat$y.km <-dat$ycoord/1000 > Error: object 'dat' not found >> dat[1:10,] > Error: object 'dat' not found >> Library(splancs)Capitalization is crucial. Unless there is a package with a function named "Library" as a function, that will not do anything useful.> I was advised to remove the '>' at begining of each line, but its > like that symbol is a default. How do i do that.We have no context for that question. But again this is not a "homework help line". You should be using you local resources for instruction> Thanks > El-Oji Adamu > Nigeria > > [[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.David Winsemius, MD West Hartford, CT