[R] read table problem
Prof Brian Ripley
ripley at stats.ox.ac.uk
Fri Feb 24 08:52:50 CET 2006
Files save()d in R should be read back with load().
.RData or .rda are common extensions for such files.
On Fri, 24 Feb 2006, Chua Tock Hing wrote:
> Hi
>
>
>
> I have a file saved in R, named agrexp.Rdata, shown below
>
>
>
>> agrdata
>
> fert yield
>
> 1 25 84
>
> 2 50 80
>
> 3 75 90
>
> 4 100 154
>
> 5 125 148
>
>
>
> If I double clicked on this file, the data is displayed without problem.
>
> However if I tried to import using:
>
>> agrdata<-read.table("agrexp.Rdata") or
>
>> agrdata<-read.table("agrexp.Rdata",header=TRUE) or
>
>> agrdata<-read.table("agrexp.Rdata",header=TRUE,row.names=1) or
>
>> agrdata<-read.table("agrexp.Rdata",sep="")
>
>
>
> I get an error message
>
> "Warning message:
>
> incomplete final line found by readTableHeader on 'agrexp.Rdata'"
>
>
>
> or if I used:
>
>> data(agrexp)
>
> I get Warning message:
>
> data set 'agrexp' not found in: data(agrexp)
>
>
>
> Can anybody please help? I am a new user!
>
>
>
> Thank you
>
>
>
> CHUA TH
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
--
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