The results are sorted on the values of the categorical variable i.e.
the variable specified with cat. If this variable is a character
vector it will be sorted alphabetically. If it is a factor it will be
sorted in the order of its levels. This function can be called as either
cat_summarise or cat_summarize.
cat_summarise(
data,
cat,
num,
na.rm = FALSE,
clean_names = getOption("tabbycat.clean_names")
)cat_summarize(
data,
cat,
num,
na.rm = FALSE,
clean_names = getOption("tabbycat.clean_names")
)
A tibble showing summary statistics for num for each group
in cat.
A dataframe containing a categorical variable and numerical variable to summarise.
The name of a column in data which is a categorical vector
of discrete values for which summaries will be calculated.
The name of a column in data which is a numerical vector
that will be summarised for each group.
A boolean indicating whether to exclude NAs from the row
results. Note that NAs are **always** ignored in calculating the summary
statistics for num shown in each row, and the number of NAs that
exist in num for each group in cat is shown in the
na column of the results table. This argument controls whether a
row of summary statistics is shown for observations that are NA in
cat. The default is FALSE.
A boolean indicating whether the column names of the
results tibble should be cleaned, so that any column names produced from
data are converted to snake_case. The default is TRUE, but this can be
changed with options(tabbycat.clean_names = FALSE).