Created
September 29, 2014 17:29
-
-
Save ramhiser/040b320e6be0711e7c70 to your computer and use it in GitHub Desktop.
Object Size of R Objects in Memory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dplyr) | |
objects <- ls() | |
object_sizes <- sapply(objects, function(x) object.size(get(x))) | |
object_sizes <- data.frame(objects, object_sizes, row.names=NULL) | |
object_sizes$units_MB <- utils:::format.object_size(object_sizes$object_sizes, units="Mb") | |
dplyr::arrange(object_sizes, object_sizes) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment