Skip to content
Back to formatted view

Raw Message

Message-ID: <BANLkTinmVXJMzb4H9sLowgUnhWJXRbK9_A@mail.gmail.com>
Date: 2011-04-13T07:09:12Z
From: C.H.
Subject: Dump the "source code" of data frame

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