View source: R/format.interval.R
format.interval | R Documentation |
format.interval
prepares intervals for results printing.
## S3 method for class 'interval' format(interval, digits = 2)
interval |
Must be a vector of two values. Values can be either numeric or character. |
digits |
Number of fixed digits, after decimal point. |
This function formats a given interval with the given number of decimal digits.
interval
is always assumed to be a two valued vector of double
.
If there is a percent sign in any of interval
values, it is removed prior to formatting by format.float
.
Returns a character value.
Felipe Figueiredo
format.interval(c(1.756, 1.823)) # format.interval(1.5, 1) # error: 1.5 is not an interval # Input is character format.interval(c("1.756", "1.823")) # Input is percentage format.interval(c("10%", "15%"), 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.