问题
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