Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 使用dput写入bestglm对象后无法读取该对象_R - Fatal编程技术网

R 使用dput写入bestglm对象后无法读取该对象

R 使用dput写入bestglm对象后无法读取该对象,r,R,我试图在逻辑回归模型上使用bestglm,该模型拟合我的数据样本较小,原始数据为100x25矩阵250kx40。 我以批处理模式运行它。我希望将bestglm模型写入一个文件 dput(test2,file="test2.txt",control=c("keepNA","keepInteger","showAttributes")) t2<-dget(file="test2.txt") Error in UseMethod("family") : no applicable meth

我试图在逻辑回归模型上使用bestglm,该模型拟合我的数据样本较小,原始数据为100x25矩阵250kx40。 我以批处理模式运行它。我希望将bestglm模型写入一个文件

dput(test2,file="test2.txt",control=c("keepNA","keepInteger","showAttributes"))
t2<-dget(file="test2.txt")
Error in UseMethod("family") : 
  no applicable method for 'family' applied to an object of class "NULL"
关于如何解决这个问题,你有什么想法吗?

最佳GLM的设计中有一些不正确的地方。如果您只是将数据输出到控制台,将其复制并粘贴回一个新对象,它将失败,并出现相同的错误

这可能是一个bug,您可能需要联系软件包维护人员。 同时,尝试使用saveRDS和readRDS:

saveRDS(test2, file="test2.rds")

t2 <- readRDS("test2.rds")