Frtab {NMTox} | R Documentation |
Generate the number of unique values, the list of unique values, or the number of observations of specified variable(s)
Description
This function produces the number of unique values, the list of unique values, or the number of observations of certain variable(s) in the dataset
Usage
Frtab(data, x, cat, val, opt=c("un", "list", "obs", "ls.obs"),
na.rm=FALSE)
Arguments
data |
Dataset |
x |
Variable(s) to be explored |
cat |
Variable used to group or subset the data |
val |
Specific value of variable |
opt |
Options for the result: If |
na.rm |
If |
Value
This function generates the number of unique values, the list of unique values, or the number of observations of specified variable(s).
Examples
# List of nanomaterial in geninvitro dataset:
Frtab(data=geninvitro, x="name", opt="list")
# How many types of endpoint are measured in geninvitro data?
Frtab(data=geninvitro, x="endpoint", opt="un")
# How many observations are available for variable "unit"?
Frtab(data=geninvitro, x="unit", opt="obs")
# How many types of endpoint and nanomaterial are available in geninvitro data?
Frtab(data=geninvitro, x=c("name","endpoint"), opt="un")
# How many types of endpoint are available for each nanomaterial
# in geninvitro data?
Frtab(data=geninvitro, x="endpoint", cat="name", opt="un")
# How many observations are available for each endpoint in each nanomaterial?
Frtab(data=geninvitro, x=c("name","endpoint"), opt="ls.obs")
# How many observations with "DNA STRAND BREAKS" as the endpoint are available
# for each nanomaterial in geninvitro data?
Frtab(data=geninvitro, x="name", cat="endpoint", val="DNA STRAND BREAKS",
opt="ls.obs")