[R] New to R and need help

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Tue Oct 15 10:17:00 CEST 2002

"Scott Marley" <azboater at dakotacom.net> writes:

> > x <- read.table("myfile.txt", header=TRUE)
> >
> > There's a number of fine points concerning missing value specification
> > and variable types, for which the help page should be consulted.
> >
> Peter and all others,
> Thank you for your help.  I was able to get the file loaded in.  The data
> set I have is unusual in regards to having spaces inbetween variables.
> Usually the columns lack spaces inbetween in my other data sets.  In SAS I
> would give the variable name then the column #.  Is there a similar
> procedure in R?

Yes, read.fwf() (fixed-width format)

Also note that the "foreign" package will allow you to read datasets
in SAS portable libraries directly. 

(These ones: libname foo xport "foo.xpt";)

   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

More information about the R-help mailing list