[R] saving datafreame object problem

Duncan Murdoch murdoch at stats.uwo.ca
Wed May 23 03:20:50 CEST 2007


On 22/05/2007 8:25 PM, toby909 at gmail.com wrote:
> Do I miss here something?
> 
> 
> dtaa = 
> read.table("http://www.ats.ucla.edu/stat/mplus/examples/ma_snijders/mlbook1.dat", 
> sep=",")
> 
> head(dtaa)   # shows the data as it should be
> 
> save(dtaa,"dtaa",file="c:/dtaa")

Besides what Thomas said:

Just give the object once.  You don't need its name separately from its 
value:

save(dtaa, file="c:/dtaa")

The way you did it you will save the object twice.
> 
> d = load("c:/dtaa")
> 
> head(d)   # all data is lost, it only shows     [1] "dtaa" "dtaa"

That's why the name was listed twice here.

Duncan Murdoch

> 
> 
> Thanks for your hint on this.
> 
> Toby
> 
> ______________________________________________
> 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
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list