Turning RData file into script files

前端 未结 3 2068
甜味超标
甜味超标 2020-12-29 14:23

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

3条回答
  •  情书的邮戳
    2020-12-29 14:55

    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.

提交回复
热议问题