Description Usage Arguments Details Value Examples
Build an attractive cross-tabulation
1 2 | crosstable(df, var1, var2, weight_var = NULL, margins = FALSE,
percent = FALSE)
|
df |
a |
var1 |
a character field name in |
var2 |
a character field name in |
weight_var |
a character field name in |
margins |
boolean, should the row and column sums be appended?
default |
percent |
boolean, should the table be a percentage?
default |
If var1,var2
are numeric vectors, then the name of the field
will be prepended to the row or column names. If not, then the bare
attribute name will be given.
an array that can be cast with kable()
or examined directly.
1 2 3 4 | crosstable(links, "facility_group", "area_name")
crosstable(links, "facility_group", "area_name", margins = TRUE)
crosstable(links, "facility_group", "area_name", percent = TRUE)
crosstable(links, "facility_group", "area_type", percent = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.