Pedro Serra
Pedro Serra

Reputation: 941

Why my small R functions are taking very much disk space?

I tried to save my R objects one by one so that I do not have to load all of them at once. I created this function:

   f_objs_save<-function(objects, dir1){
      for (obj in objects){
        print (obj)
        save(list=c(obj),file=paste0(dir1,"\\",obj,".Rdata"))
      }
    }

It worked but some very small functions/objects are taking a lot of space on disk and time to load, more then 50K for 10 lines functions. Another bigger functions are taking less then 1K on disk. See my File Manager

I guess it is saving more then just the function. How can I avoid this problem and save it in a propper way ?

Upvotes: 2

Views: 225

Answers (0)

Related Questions