tbl_n_rfrnds | R Documentation |
Creates a ready-to-print gt table with the number of referendums, optionally counted by
up to three additional variables.
tbl_n_rfrnds(
data,
by = NULL,
complete_fcts = TRUE,
n_rows = Inf,
order = NULL,
incl_row_head = TRUE,
incl_col_head = TRUE,
add_total_row = NULL,
add_total_col = NULL,
lbl_total_row = gt::md("**Total**"),
lbl_total_col = gt::md("**Total**")
)
data |
RDB referendum data as returned by |
by |
Up to three additional |
complete_fcts |
Whether or not to complete the result with implicitly missing combinations of those columns specified in |
n_rows |
Maximum number of rows to be included in the resulting table. All the rows exceeding that limit are replaced by a single row of ellipses. An
integer scalar or |
order |
How to order the rows of the resulting table. One of
|
incl_row_head |
Whether or not to include a row heading with the prettified name of the first |
incl_col_head |
Whether or not to include column headings (in the table's stub) with the prettified names of
the second and third |
add_total_row |
Whether or not to add a summary row at the very end of the table containing column totals. If |
add_total_col |
Whether or not to add a summary column at the very end of the table containing row totals. If |
lbl_total_row |
Label of the summary row containing column totals. Only relevant if |
lbl_total_col |
Label of the summary column containing row totals. Only relevant if |
The first variable specified in by
will be reflected in additional rows in the resulting table, i.e. expand it vertically. The second and third variables
will be reflected in additional columns, i.e. expand it horizontally.
A gt_tbl
object.
Other tabulation functions:
tbl_n_rfrnds_per_period()
rdb::rfrnds(quiet = TRUE) |>
rdb::tbl_n_rfrnds()
# grouped by a single column
rdb::rfrnds(quiet = TRUE) |>
rdb::tbl_n_rfrnds(by = level)
# grouped by two columns
rdb::rfrnds(quiet = TRUE) |>
rdb::tbl_n_rfrnds(by = c(type, level))
# grouped by three columns
rdb::rfrnds(quiet = TRUE) |>
rdb::tbl_n_rfrnds(by = c(country_name, level, type),
n_rows = 10L,
order = "descending")
# count ballot dates instead of referendums
rdb::rfrnds(quiet = TRUE) |>
rdb::as_ballot_dates() |>
rdb::tbl_n_rfrnds(by = c(country_name, level),
n_rows = 10L,
order = "descending")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.