When I use the following R code,
model_glm=glm(V1~. , data=xx,family=\"binomial\");
save(file=\"modelfile\",model_glm);
The size of modelfile w
object.size()
is misleading because it ignores the environment attributes.
If you want to assess the true size, use:
length(serialize(model_glm, NULL))
Apart from the data stored, if you want to significantly reduce the size of your glm do:
rm(list=ls(envir = attr(model_glm$terms, ".Environment")),
envir = attr(model_glm$terms,
".Environment"))
This comes from a well detailed article