Calculate the size of any R object or directory
Arguments
- x
Object
- units
Character. Specify which unit to use, i.e. "Gb", "Mb", "Kb".
- path
a character vector of full path names; the default corresponds to the working directory,
getwd()
. Tilde expansion (seepath.expand
) is performed. Missing values will be ignored. Elements with a marked encoding will be converted to the native encoding (and if that fails, considered non-existent).- recursive
logical. Should the listing recurse into directories?
- ...
further arguments passed to or from other methods.
See also
Other Tools:
autoline()
,
bind_files()
,
bring_api()
,
chr2num()
,
db_download()
,
db_upload()
,
export_plot()
,
export_results()
,
files_functions()
,
font_exists()
,
formatColoured()
,
formatHTML()
,
get_credentials()
,
glued()
,
grepm()
,
h2o_selectmodel()
,
haveInternet()
,
image_metadata()
,
importxlsx()
,
ip_data()
,
json2vector()
,
list_cats()
,
listfiles()
,
mail_send()
,
markdown2df()
,
move_files()
,
msplit()
,
myip()
,
quiet()
,
read.file()
,
statusbar()
,
tic()
,
try_require()
,
updateLares()
,
warnifnot()
Examples
what_size(seq(1:1e3), "Kb")
#> [1] "4 Kb"
what_size(seq(1:1e6))
#> [1] "3.8 Mb"
what_size(as.character(seq(1:1e6)))
#> [1] "61 Mb"
what_size(path = ".")
#> [1] " Mb"