Learn R Programming

NMTox (version 0.1.0)

FrCtrl: Create a frequency table of the control values

Description

This function provides a table containing the frequencies of the control values and the number of available data in the specified dataset. Since it is possible to have a dose with different units of measurement in one dataset, this function helps in showing how many control values are available for each nanomaterial for a specific unit of measurement of the dose.

Usage

FrCtrl(data.nm, data.control, id, nano, dose, end, end.cat, unit,
  unit.cat, vars)

Value

The value returned from FrCtrl is a table containing:

  • Freq(Dose=0.0).same: frequency of control values with dose measured in unit.cat

  • Freq(obs).same: number of observations with dose measured in unit.cat

  • Freq(Dose=0.0).all: frequency of control values with dose measured unit.cat and in other units of measurement

  • Freq(obs).all: number of observations with dose measured in unit.cat and control dose measured in any units,

for each nanomaterial or subset of data

Arguments

data.nm

Data containing the result of toxicity study

data.control

Data of control values

id

Identifier of the experiment

nano

Name of the nanomaterial

dose

Dose or concentration

end

Toxicity endpoint

end.cat

Specific toxicity endpoint of interest

unit

Unit of measurement of the dose

unit.cat

Specific unit of measurement of the dose

vars

Variables used to subset the data

Details

  • This function performs data exploration for each nanomaterial in the dataset (or for each subset of data). The different types of nanomaterials are identified by their names. Therefore, if some control values are named differently (see: geninvitro dataset and the Examples), a separate dataset containing only these values first needs to be created. Controls in the new dataset can be linked to the non-control observations belonging to the same experiment through the identifier of the experiment (the linking is performed inside this function). In this situation, it is necessary to have an indicator that can identify different experiments (such as experiment ID).

  • If all controls in the dataset are named according to the related nanomaterial names, data.control and id do not need to be specified.

  • The exploration can also be performed on the subsets of data by splitting the data of each nanomaterial according to the variable(s) specified in vars

Examples

Run this code
# Create a dataset containing controls (which are named differently)
# from geninvitro dataset:
controldata<-SubsetData(data=geninvitro, x="name", x.cat=c("control", "Control",
             "medium", "medium + BSA", "untreated"))

# Exclude controls (which are named differently) from geninvitro dataset:
invitrodata<-SubsetData(data=geninvitro, x="name", x.cat=c("control", "Control",
             "medium", "medium + BSA", "untreated"), include=FALSE)

# Frequency of controls for each nanomaterial in geninvitro dataset
# with DNA STRAND BREAKS as the toxicity endpoint and concentration
# measured in "ug/cm2":
#
FrCtrl(data.nm=invitrodata, data.control=controldata, nano="name",
       end="endpoint", end.cat="DNA STRAND BREAKS", id="experimentID",
       dose="concentration", unit="concentration_unit", unit.cat="ug/cm2")

# Frequency of controls for each cell type in each nanomaterial
# (in geninvitro dataset) with DNA STRAND BREAKS as the toxicity
# endpoint and concentration measured in "ug/cm2":
#
FrCtrl(data.nm=invitrodata, data.control=controldata, nano="name",
       end="endpoint", end.cat="DNA STRAND BREAKS", id="experimentID",
       dose="concentration", unit="concentration_unit", unit.cat="ug/cm2",
       vars="celltype")

Run the code above in your browser using DataLab