# Simple example: maximum addressible size of 32 bit pointer
humanReadable(2^32-1)
humanReadable(2^32-1, standard="IEC")
humanReadable(2^32-1, standard="SI")
humanReadable(2^32-1, standard="Unix")
humanReadable(2^32-1, unit="MiB")
humanReadable(2^32-1, standard="IEC", unit="MiB")
humanReadable(2^32-1, standard="SI", unit="MB")
humanReadable(2^32-1, standard="Unix", unit="M")
# Vector of sizes
matrix(humanReadable(c(60810, 124141, 124, 13412513), width=4))
matrix(humanReadable(c(60810, 124141, 124, 13412513), width=4, unit="KiB"))
# Specify digits rather than width
matrix(humanReadable(c(60810, 124141, 124, 13412513), width=NULL, digits=2))
# Change the justification
matrix(humanReadable(c(60810, 124141, 124, 13412513), width=NULL,
justify=c("right", "right")))
Run the code above in your browser using DataLab