nID_nSp | R Documentation |
Calculate number and percentage of unique IDs and observations.
number(IDs) >= number(observations)
# DEFAULT BEHAVIOUR OF FUNCTION CHANGED
nID_nSp(
data = NULL,
ID,
gr,
ID_text = "medical specimens",
observation_text = "spectra",
decimals = 1
)
nID_nObs(
data = NULL,
ID,
gr,
ID_text = "unique IDs",
observation_text = "observations"
)
data |
A data frame with variables, that names are denoted by |
ID |
Vector with speciment IDs (Either a vector or a variable name in |
gr |
Vector with speciment groups (Either a vector or a variable name in |
ID_text |
A title for unique IDs, that apear in the table. |
observation_text |
A title for observations, that apear in the table. |
decimals |
A number of maximum decimal places in percentages.
This parameter is passed to function |
Table (data frame) with count and percentages.
Vilmantas Gegzna
data(DataSet1)
nID_nSp(DataSet1, "ID", "gr")
nID_nSp(ID = DataSet1$ID, gr = DataSet1$gr)
pander::pander(nID_nSp(DataSet1, "ID", "gr"))
nID_nObs(DataSet1, "ID", "gr")
pander::pander(nID_nObs(DataSet1, "ID", "gr"))
# For hyperSpec object
nID_nSp(Spectra2$.., ID = "class", "gr")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.