Is there a straightforward way to turn the functions of a .RData file into a normal code file (.R)?
+9
A:
Check out ?dump
. For example:
newEnv <- new.env()
load("myFunctions.Rdata", newEnv)
dump(c(lsf.str(newEnv)), file="normalCodeFile.R", envir=newEnv)
You may also be interested in ?prompt
(which creates documentation files for objects) and / or ?package.skeleton
.
Joshua Ulrich
2010-10-01 00:28:35
Great update Joshua. I updated my post to include your solution as well. http://www.r-statistics.com/2010/09/dumping-functions-from-the-global-environment-into-an-r-script-file/
Tal Galili
2010-10-02 07:07:54