Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turning RData file into script files

Tags:

r

rdata

Is there a straightforward way to turn the functions of a .RData file into a normal code file (.R)?

like image 657
Christian Avatar asked Oct 01 '10 00:10

Christian


1 Answers

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.

like image 145
Joshua Ulrich Avatar answered Oct 15 '22 05:10

Joshua Ulrich