View source: R/tidyConvertToProbabilities.R
classCountFromGroup | R Documentation |
Helper function to calculate observed class counts of discrete variable X in grouped data in a tidy friendly manner. Class counts are needed for certain corrections to the entropy and
classCountFromGroup(df, groupVars, summarise = FALSE)
df |
a dataframe containing 2 columns defining class of event X and class of event Y and either one row per event, or a count of observations, for each class combination. df may also be grouped and in which case the grouping is preserved in the result. |
groupVars |
the datatable column(s) defining the class of the observation quoted by vars(...) |
summarise |
- return a mutated (FALSE) or summarised (TRUE) result of the df |
countVar |
the datatable column containing the observed frequency combination of event XY. If this is missing the row count will be used instead |
A mutated datatable with the count of possible values of X as C (repeated for every observation of X) and the corresponding maximum entropy of the source (max_H)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.