Can't import an object saved to file with dput in R

∥☆過路亽.° 提交于 2019-12-25 05:48:15

问题


Hello I created an list object that contains boot the object returned by the boot::boot() function and a summary of results I build on the top of that.

I saved such object to a file using dput. But now I can't regenerate the object using dget() or source(). I receive this error:

bt <- dget(file.choose())
Error in sample.int(n, n * R, replace = TRUE) : object 'R' not found

Since I called boot() and used dput in another function I suspected that to rebuild a bt object the R variable which was an argumento to boot() is required to exist also in the global environment (not the best implementation). So I created such variable in the global:

R = 5000
bt <- dget(file.choose())
bt
[1] ""
bt <- source(file.choose())
bt
$value
[1] ""

$visible
[1] TRUE

Empty objects!

Any idea?

Here's a link to the file https://www.dropbox.com/s/xceeoewidm87gtv/CFC%20vs%20BRAF.r?dl=0

来源:https://stackoverflow.com/questions/33026738/cant-import-an-object-saved-to-file-with-dput-in-r

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