[R] Read.table problem

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Sat Feb 1 13:40:03 CET 2003


Let's try to scotch this one.

That is what happens with an unpatched build of R 1.6.2 on classic MacOS,
which has CR line endings in text files and the OS is not treating as
text-mode files (as say Windows does and many Mac applications do).  It
happens only with such files and only with R 1.6.2.  There is a patch on 
CRAN for those who downloaded rm162 before Jan 22.

On Sat, 1 Feb 2003, Christian Schulz wrote:

> Perhaps your data entrys delimited with comma, semicolon so you have
> to use sep="," or sep=";" .
> 
> For tab-delimited data i take read.delim.
> 
> hope this helps.christian
> 
> 
> 
> 
> ----- Original Message -----
> From: "ptremb17" <ptremb17 at po-box.mcgill.ca>
> To: "R-HELP" <r-help at stat.math.ethz.ch>
> Sent: Saturday, February 01, 2003 3:24 AM
> Subject: [R] Read.table problem
> 
> 
> > Hi !
> >
> > I am new to R, and using the MAC version onto Mac OS 9.1. My question
> concerns
> > the problem I encounter when I try to read some data I have using the
> > read.table function. I always get an error of type : Error in scan(file =
> > file, what = what, sep = sep, quote = quote, dec = dec,  :
> > line 1 did not have 9 elements
> >
> > Here is my code:
> >
> > varnames <- c("names", "symbol", "price", "displ", "gas", "weight",
> "reliab",
> > "origin", "type")
> >
> > cardat <- read.table("PowerMac 7300:Logiciels de
> > Statistiques:rm162:car02.txt", col.names=varnames,
> > as.is=c(F,T,F,F,F,F,F,F,F,F))
> >
> > Can you advice me ?
> >
> > Thanks in advance,
> >
> > Pascale Tremblay
> >
> > ______________________________________________
> > R-help at stat.math.ethz.ch mailing list
> > http://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> http://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 

-- 
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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list