View source: R/table_relfreq.R
table_relfreq | R Documentation |
Mostly used as an internal function, but could also be convenient to transform frequencies (i.e., number of individuals having a given trait) into relative frequencies (i.e., proportions).
table_relfreq(tab)
tab |
A table of sample sizes and frequencies, such as the tables
returned by the function |
The last K
rows (K
being the number of groups) of
tab
are simply transformed to relative frequencies.
Frédéric Santos, frederic.santos@u-bordeaux.fr
binary_to_table
, start_mmd
## Load and visualize a binary dataset:
data(toyMMD)
head(toyMMD)
## Convert this dataframe into a table of sample sizes and frequencies:
tab <- binary_to_table(toyMMD, relative = FALSE)
tab
## Convert this table into relative frequencies:
table_relfreq(tab)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.