| deb_convert_unit | R Documentation |
deb_decimal vectorsConvert the unit attribute of deb_decimal vectors.
deb_convert_unit(x, to = c("l", "s", "d", "f"))
x |
A vector of class |
to |
A character vector of length one indicating the unit to be
converted to. Choice of |
deb_convert_unit() converts the unit of a deb_decimal vector to
either "l", "s", "d", or optionally "f" if the vector has
tetrapartite bases. This changes the representation of the vector,
but the value remains equivalent.
A deb_decimal vector with a converted unit attribute.
x <- deb_decimal(c(8.825, 15.125, 3.65))
y <- deb_decimal(c(56.45, 106.525, 200.4), unit = "s")
z <- deb_decimal(c(8472, 14520, 3504),
unit = "f",
bases = c(20, 12, 4))
deb_convert_unit(x, to = "s")
deb_convert_unit(x, to = "d")
deb_convert_unit(y, to = "l")
deb_convert_unit(y, to = "d")
deb_convert_unit(z, to = "l")
deb_convert_unit(z, to = "s")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.