mround | R Documentation |
mround()
is a convenience function I wrote for my annotating bar charts that I make.
Assuming a proportion variable, mround()
will multiply each value by 100 and round it for presentation.
By default, it rounds to two. The user can adjust this.
mround(x, d = 2)
x |
a numeric vector |
d |
the number of decimal points to which the user wants to round. If this is not set, it rounds to two decimal points. |
This is a sister function of make_perclab()
in the same package. This, however, won't add a percentage sign.
The function takes a numeric vector, multiplies it by 100, rounds it (to two digits by default), and returns it to the user.
x <- runif(100)
mround(x)
mround(x, 2) # same as above
mround(x, 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.