pryr::mem_used() 默认显示内存使用为兆字节。为什么它在乘法(或除法)后转换单位名称(例如 MB -> GB)而不是值?
library(pryr)
mem_used()
97.1 MB
mem_used()/1000
97 kB
mem_used()*1000
97 GB
sessionInfo()
R version 3.2.0 (2015-04-16)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.9.5 (Mavericks)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] dplyr_0.4.2 data.table_1.9.4 pryr_0.1.2 readr_0.1.1 magrittr_1.5 XML_3.98-1.3
[7] vegdata_0.7 foreign_0.8-63
loaded via a namespace (and not attached):
[1] Rcpp_0.11.6 codetools_0.2-11 assertthat_0.1 chron_2.3-47 plyr_1.8.3 R6_2.1.0
[7] DBI_0.3.1 stringi_0.5-5 reshape2_1.4.1 lazyeval_0.1.10 tools_3.2.0 stringr_1.0.0
[13] parallel_3.2.0
编辑:这个问题是指 mem_used() 输出的格式化方式。