keep_units | R Documentation |
Helper function to apply a function to a units
object and then restore
the original units.
keep_units(FUN, x, ..., unit = units(x))
FUN |
the function to be applied. |
x |
first argument of |
... |
optional arguments to |
unit |
symbolic unit to restore after |
Provided for incompatible functions that do not preserve units. The user is responsible for ensuring the correctness of the output.
An object of class units
.
x <- set_units(1:5, m)
keep_units(drop_units, x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.