convert | R Documentation |
Convert units.
convert(x, ...)
## S3 method for class 'numeric'
convert(x, from = c("mm", "cm", "in"), to = c("mm", "cm", "in"), ...)
## S3 method for class 'figure'
convert(x, to = c("mm", "cm", "in"), ...)
x |
a numeric vector or a figure object. |
... |
extra arguments passed to methods. |
from |
the input unit. |
to |
the target unit. |
'convert()' is a S3 generic function with methods defined for numeric vectors and the 'figure' class.
a numeric vector after the unit conversion or a 'figure' class object with the unit information altered.
convert(10, 'mm', 'cm')
convert(180, 'mm', 'in')
convert(7.086614, 'in', 'mm')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.