[R] Dump the "source code" of data frame

C.H. chainsawtiney at gmail.com
Wed Apr 13 09:09:12 CEST 2011


Dear R experts,

I remember a similar function existed and have been mentioned in
R-help before. I tried my best to search but I really can't find it
out.

suppose I have an data frame like this:

> somedata <- data.frame(age.min = 1, age.max = 1.5, male = TRUE, l = -1.013, m=16.133, s=0.07656)

In order to back up the data and I don't want to use write.table(), I
would like to back up the "source code" of the data frame. When I
apply that function (let's call it dumpdf() ), the function will
reproduce the "source code" that creates the data.frame. For example:

> dumpdf(somedata)
somedata <- data.frame(age.min = 1, age.max = 1.5, male = TRUE, l =
-1.013, m=16.133, s=0.07656)

Is there any function similar to the dumpdf() above?

Thank you so much!

Regards,

CH

-- 
CH Chan



More information about the R-help mailing list