dump() in R not source()able- output contains “…”

不问归期 提交于 2020-01-15 11:06:51

问题


I'm trying to use dump() to save the settings of my analysis so I can examine them in a text editor or reload them at a later date.
In my code I'm using the command

dump(ls(), settingsOutput, append=TRUE)

The file defined by `settingsOutput' gets created, but the larger objects and locally defined functions are truncated. Here's an excerpt from such a file. Note these files are generally on the order of a few kb.

createFilePrefix <-
function (runDesc, runID, restartNumber) 
{
  ...
createRunDesc <-
function (genomeName, nGenes, nMix, mixDef, phiFlag) 
{
  ...
datasetID <-
"02"
descriptionPartsList <-
c("genomeNameTest", "nGenesTest", "numMixTest", "mixDefTest", 
"phiFlagTest", "runDescTest", "runIDTest", "restartNumberTest"
  ...
diffTime <-
structure(0.531, units = "hours", class = "difftime")
dissectObjectFileName <-
function (objectFileName) 
{
  ...
divergence <-
0

Just for reference, here's one of the functions defined above

createFilePrefix <- function(runDesc, runID, restartNumber){
    paste(runDesc,  "_run-", runID, "_restartNumber-", restartNumber, sep="")
}

Right now I'm going back and removing the problematic lines and then loading the files, but I'd prefer to actually have code that works as intended.

Can anyone explain to me why I'm getting this behavior and what to do to fix it?

来源:https://stackoverflow.com/questions/40820774/dump-in-r-not-sourceable-output-contains

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!