cat_vcount {tabbycat} | R Documentation |
Count the frequency of discrete values in a categorical vector
Description
This function differs from cat_count
in that it operates directly on
vectors, rather than on columns in dataframes, which means it is less useful
in pipelines but can handle a wider range of inputs. The results are sorted
in descending order of frequency.
Usage
cat_vcount(
cat,
na.rm = FALSE,
only = "",
clean_names = getOption("tabbycat.clean_names")
)
Arguments
cat |
A categorical vector for which frequencies will be calculated. |
na.rm |
A boolean indicating whether to exclude NAs from the results. The default is FALSE. |
only |
A string indicating that only one of the frequency columns
should be returned in the results. If |
clean_names |
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 |
Value
A tibble showing the frequency of each value in cat
.