xP | R Documentation |
Prints numbers nicely formatted, with optional units. Primarily for internal use in text processing of knitr
output. Not usually referenced by the user.
xP(x, d_d=NULL, unit=NULL, semi=FALSE)
x |
The variable. |
d_d |
The digits. |
unit |
Unit of measurement for the variable. |
semi |
Add a semicolon before the unit to add some horizontal spacing in math mode. |
Input is numeric, output is formatted text. A special unit is "$"
, which is added to the front of the number instead of as a trailing descriptor.
David W. Gerbing (Portland State University; gerbing@pdx.edu)
xP(12345678.9, d_d=2, unit="$")
xP(12345678.9, d_d=2, unit="lbs")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.