nmplot.ncat {NMTox} | R Documentation |
Create plots of the dose and the response differentiated by specified variables
Description
This function generates scatter plots of the dose and the response for every unique value of a certain variable, with the colour of the data points differentiated according to the value of another variable.
Usage
nmplot.ncat(data.nm, data.control, id, nano, response, dose, end,
end.cat, unit, unit.cat, cat, x.cat, type=c("dose","log"),
control.opt=c("same","all"), nrow=1, ncol=1)
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 |
response |
Response (endpoint value) |
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 |
cat |
Plot is generated for every unique value of |
x.cat |
Variable used to differentiate the colour of the data points in the plot(s) |
type |
Type of the dose to be plotted (" |
control.opt |
Option for the control doses. If only control doses with
the same unit of measurement as the non-control ones are included, then
specify " |
nrow |
Number of rows in the plotting space (default is 1) |
ncol |
Number of columns in the plotting space (default is 1) |
Details
This function generates plots for each nanomaterial in the dataset. The different types of nanomaterials are identified by their names. Therefore, if some control values are named differently (see:
geninvitro
dataset and theExamples
), 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
andid
do not need to be specified.If doses used in the experiment are all measured in the same unit of measurement, then specify "
same
" incontrol.opt
.
Value
This function produces dose-response plots for every unique value of a certain variable, with different colours of data points based on the value of another variable
Examples
# 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)
# Generate dose-response plots for geninvitro, with DNA STRAND BREAKS as
# the endpoint and concentrations measured in "ug/cm2" (plot is generated for
# each study provider, with different colours represent different
# experiments):
#
nmplot.ncat(data.nm=invitrodata, data.control=controldata,
id="experimentID", nano="name", response="value",
dose="concentration", end="endpoint", end.cat="DNA STRAND BREAKS",
unit="concentration_unit", unit.cat="ug/cm2", cat="studyprovider",
x.cat="experimentID", type="dose", control.opt="same", nrow=1,
ncol=1)