tidymodels / butcher

Reduce the size of model objects saved to disk
https://butcher.tidymodels.org/
Other
131 stars 12 forks source link

Reduce the size model objects from lfe::felm() #141

Open jyuu opened 4 years ago

jyuu commented 4 years ago

Code to reduce the size of a model object from lfe::felm():

small_felm <- function(m){ m$fe <- NULL m$residuals <- NULL m$r.residuals <- NULL m$fitted.values <- NULL m$response <- NULL m$cfactor <- NULL m$inv <- NULL m$STATS$promotion <- NULL m$clustervar <- NULL m }

Thanks to @adamlauretig

adamlauretig commented 4 years ago

Just a note, you'll probably want to pass keepX = FALSE, keepCX = FALSE to the felm when you're fitting the model, if possible.