Description Usage Arguments Value Note See Also Examples
This function looks at a table, finds indices of the least frequent response category (or categories), and returns one as a starting point for collapse().
1 | i_freq_min(tbl, return_which = c("min", "max"))
|
tbl |
A table, usually one that was made from a vector of response categories. |
return_which |
In situations in which more than one response category is the least frequent (i.e., with the lowest frequency count), should the function return the minimum response (i.e., the leftmost category if sorted in ascending order) or the maximum response (i.e., the rightmost category if sorted in ascending order). The default is "min" for "minimum" or the "rightmost" response option. This parameter is only relevant when more than one response category is tied for being the least frequent. |
A single numeric index in tbl that tells collapse() which response category to start with.
This is intended as an internal function to the collapse() function. Use with care for other purposes.
collapse()
1 2 3 4 5 6 7 8 | ## Not run:
sparse_vector <- c(1, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 4, 4, 5, 5)
i_freq_min(table(sparse_vector))
table(sparse_vector) |> i_freq_min()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.