Description Usage Arguments Details Value Examples
View source: R/prepare_ext_obs_table.R
Reads a data frame, sorts it by the given variable and displays the top and bottom n observations.
1 2 3 4 5 6 7 8 9 |
df |
Data frame |
n |
The number of top/bottom observations that you want to report. |
cs_id |
The variable(s) identifying the cross-section in the data. |
ts_id |
The variable identifying the time-series in the data. |
var |
Variable to display. Defaults to the last numerical variable of the data frame. |
... |
Additional parameters that are passed to |
When both cs_id
and ts_id
are omitted, all variables are tabulated.
Otherwise, var
is tabulated along with the identifiers.
Infinite values in var
are omitted.
The default parameters for calling kable
,
are format = "html", digits = 3, format.args = list(big.mark = ','), row.names = FALSE
.
A list containing two items:
A data frame containing the top/bottom n observations
The return value provided by kable
containing the formatted table
1 2 3 4 | t <- prepare_ext_obs_table(russell_3000, n = 10,
cs_id = c("coid", "coname"),
ts_id = "period", var = "sales")
t$df
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.