Round numbers in a table, each column to appropriate number of significant digits
Source:R/table_signif.R
table_signif.RdRound numbers in a table, each column to appropriate number of significant digits
Arguments
- dat
data.frame or table in data.table format of numbers
- digits
vector as long as number of columns in dat, or use default which is to get the number of significant digits from varinfo(colnames(dat), 'sigfigs')$sigfigs which gets it from map_headernames dataset of metadata on EJAM / EJSCREEN indicators.
See also
table_signif_round_x100() table_signif() table_round() table_x100()
Examples
out <- testoutput_ejamit_10pts_1miles
mytable <- out$results_bysite[1:2, ..names_these]
EJAM:::table_signif_round_x100(mytable)
# same as this:
EJAM:::table_signif(
EJAM:::table_round(
EJAM:::table_x100(
mytable, names_pct_as_fraction_ejamit
)
)
)