Tricks to manage the available memory in an R session

前端 未结 27 1358
情深已故
情深已故 2020-11-22 01:23

What tricks do people use to manage the available memory of an interactive R session? I use the functions below [based on postings by Petr Pikal and David Hinds to the r-he

27条回答
  •  有刺的猬
    2020-11-22 01:59

    This is a newer answer to this excellent old question. From Hadley's Advanced R:

    install.packages("pryr")
    
    library(pryr)
    
    object_size(1:10)
    ## 88 B
    
    object_size(mean)
    ## 832 B
    
    object_size(mtcars)
    ## 6.74 kB
    

    (http://adv-r.had.co.nz/memory.html)

提交回复
热议问题