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 cat. If val is specified, then only result for this value will be shown.

opt

Options for the result: If opt is un, then the number of unique values of x will be counted. If opt is list, then the list of unique values of x will be generated. If opt is obs, then the number of observations of x will be counted. If opt is ls.obs, then the number of observations for each unique value will be generated.

na.rm

If na.rm is FALSE (the default), then missing values are not removed from the dataset. If na.rm=TRUE, then missing values are removed from the dataset

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")



[Package NMTox version 0.1.0 Index]