object_size.Rd
object_size
works on an object and provides the size of the
object using utils::object.size
. as.object_size
converts a numeric
value to the units indicated in the unit
argument.
object_size(x, unit = "MB", standard = "SI")
as.object_size(x, unit = "MB", standard = "SI")
an R object.
the byte-size unit standard to be used. A character
string, possibly abbreviated from "legacy"
, "IEC"
,
"SI"
and "auto"
. See ‘Formatting and printing
object sizes’ for details.
A scalar character vector of the input object's size in the units requested
var <- 1e10
object_size(var, unit = "KB")
#> [1] "0.1 kB"
as.object_size(2500000)
#> [1] "2.5 MB"