as_rave_unit | R Documentation |
Convert numeric number into print-friendly format
as_rave_unit(x, unit, label = "")
x |
numeric or numeric vector |
unit |
the unit of |
label |
prefix when printing |
Still numeric, but print-friendly class
sp <- as_rave_unit(1024, 'GB', 'Hard-disk space is ')
print(sp, digits = 0)
sp - 12
as.character(sp)
as.numeric(sp)
# Vectorize
sp <- as_rave_unit(c(500,200), 'MB/s', c('Writing: ', 'Reading: '))
print(sp, digits = 0, collapse = '\n')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.