Description Usage Arguments Details Value Examples
View source: R/applyTemplate.R
applyTemplate is called internally by mtable
to format coefficients and summary statistics.
1 2 3 |
x |
a numeric or character vector to be formatted |
template |
a character vector that defines the template, see details. |
float.style |
A character string that is passed to |
digits |
number of significant digits to use if not specified in the template. |
signif.symbols |
a named vector that specifies how significance levels
are symbolically indicated, values of the vector specify
significance levels and names specify the symbols. By default, the
|
Character vectors that are used as templates may be arbitrary. However,
certain character sequences may form template expressions.
A template expression is of the form ($<POS>:<Format spec>),
where "($" indicates the start of a template expression,
"<POS>" stands for either an index or name that selects an
element from x and "<Format spec>" stands for a
format specifier. It may contain an letter indicating the
style in which the vector element selected by <POS>
will be formatted by formatC, it may contain
a number as the number of significant digits, a "#"
indicating that the number of signifcant digits will be at most that given
by getOption("digits"), or * that means that
the value will be formatted as a significance symbol.
applyTemplate returns a character vector in which template
expressions in template are substituted by formatted values from x.
If template is an array then the return value is also an array of
the same shape.
1 2 | applyTemplate(c(a=.0000000000000304,b=3),template=c("($1:g7#)($a:*)"," (($1:f2)) "))
applyTemplate(c(a=.0000000000000304,b=3),template=c("($a:g7#)($a:*)"," (($b:f2)) "))
|
Loading required package: lattice
Loading required package: MASS
Attaching package: 'memisc'
The following objects are masked from 'package:stats':
contr.sum, contr.treatment, contrasts
The following object is masked from 'package:base':
as.array
[,1]
[1,] "3.04e-14***"
[2,] " (0.00) "
[,1]
[1,] "3.04e-14***"
[2,] " (3.00) "
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.