문제

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

도움이 되었습니까?

해결책

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.

다른 팁

There's another solution from another post using sink

sink(file="Function.R")
Function # The object
sink()
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top