hsize | R Documentation |
Convert byte sizes into human-readable byte sizes.
## S3 method for class 'numeric'
hsize(sizes, digits=1L, units="auto", standard=getOption("hsize.standard", "IEC"),
bytes=getOption("hsize.bytes", "B"), ...)
## S3 method for class 'object_size'
hsize(sizes, ...)
sizes |
A |
digits |
Number of digits to be presented in the give unit. |
units |
A |
bytes |
The string used for units of bytes without a prefix.
Applied only if |
... |
Not used. |
A character
vector
.
Henrik Bengtsson
object.size
.
sizes <- c(1000^(0:8), 1024^(0:8))
df <- data.frame(size=sizes)
df$SI <- hsize(sizes, standard="SI")
df$TB <- hsize(sizes, units="TB")
df$IEC <- hsize(sizes, standard="IEC")
df$TiB <- hsize(sizes, units="TiB")
print(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.