View source: R/count_spectra.R
count_spectra | R Documentation |
Summary statistics of factor variable in a hypecSpec object by ID
count_spectra(
OBJ,
Var = NULL,
ID = "ID",
decimals = 1,
include_na = TRUE,
na_level = "(Missing)",
na.rm = TRUE,
total = FALSE
)
OBJ |
hyperSpec object |
Var |
(string) variable name of factor variable |
ID |
(string) variable name of ID variable |
decimals |
(integer) number of decimals to round to calculating the percentages. Default is 2. |
include_na |
(logical) If |
na_level |
(character) Name for the level, which represents |
na.rm |
(logical) used by function |
FALSE |
(logical) Add row with "total". |
a data frame with counts and percentages by group and ID
Other count spectra functions:
has_enough_IDs()
,
has_too_few_IDs()
count_spectra(Spectra2, "class", ID = "gr")
count_spectra(OBJ = Spectra2, Var = "class", ID = "gr")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.