Whether I want to load a package that contains a function that I want versus writing my own function depends largely on the size of the package. How I can get the size of the package (without looking through my directories) with code? Also, is there code that can tell me how much memory each of my loaded/attached packages are taking up in my workspace?
Loading packages does not take much memory. You can use mem_used()
function from package pryr
to estimate the memory growth with each package being loaded:
library(pryr)
mem_used()
# 74.1 MB
library(dplyr)
mem_used()
# 77 MB
library(data.table)
mem_used()
#78.2 MB
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With