format.pct | R Documentation |
format.pct
prepares proportions as percentages for results printing, possibly with a percent sign.
## S3 method for class 'pct' format(p, digits = 1, pct.symbol = TRUE)
p |
a numeric vector assumed to be a proportion. |
digits |
the number of decimal digits to be used in the output. |
pct.symbol |
(logical) whether or not to include the percent sign in the output. |
This function multiplies the proportion by 100, formats with the given number of decimal digits. It also (optionally) includes a percent sign.
A character value formatted as percentages
Felipe Figueiredo
format.pct(.1) format.pct(c(.42, .99), 0) m <- 10*matrix(c(1, 1.1, .9, 2), nrow = 2) format.pct(fisher.test(m)$p.value) format.pct(fisher.test(5*m)$p.value) format.pct(fisher.test(m)$conf.int)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.