Description Usage Arguments Details Value Author(s) See Also Examples
Function genloq
uses given (or determines) threshold of the limit of quantification and substitutes string "LoQ"
of values below it.
1 2 3 4 |
x |
a vector of concentration values (of class |
y |
a vector of measurement dates in the case of vector input only. |
input |
a type of data frame in the case of data frame input. The allowed values are |
output |
a type of output data frame. As in the |
loq |
a value of the limit of quantification which will be used for all pollutants. |
method |
method of values below LoQ substitution. Allowed values are |
distr |
if |
pollutant |
a name(s) of the pollutant(s), for which the LoQs are substituted. Not necessary if only data for one pollutant is available in |
plot |
logical. Indicates, whether plot should be plotted. |
ylim |
vector of class |
columns |
number of columns in the multi-plot arrangement. |
col.points |
color of over LoQ points inside the plot. |
pch |
plotting 'character', i.e., symbol to use. For more details see points. |
xlab |
the x label of the plot. |
ylab |
the y label of the plot. |
main |
overall title for the plot. |
The genloq
function substitutes values below the limit of quantification (LoQ) (equivalently the limit of detection (LoD)) marked as "loq", "LoQ" or "LOQ" in the x
. Although both data frames of types "openair" and "genasis" are defined with columns containing concentration values of class "numeric"
, it is necessary to mark values below LoQ as character string - thus here is an exception from the definition and both data types "openair" and "genasis", as well as vector x
could contain concentration values of class "character"
. See 'Examples' paragraph.
Thus the function recognises three different input formats: Option input="openair"
uses "openair" format of data frame with first column of name "date"
and class "Date"
, optional columns of names "date_end"
, "temp"
, "wind"
and "note"
and other columns of class "numeric"
or "character"
containing concentration values and named by names of the compounds. input="genasis"
is used for the data frame with six columns "valu"
, "comp"
, "date_start"
, "date_end"
, "temp"
and "wind"
where the first could be both "numeric"
or "character"
class, fifth and sixth are of class "numeric"
, second of class "character"
and third and fourth columns could be both "character"
or "Date"
class. The names of columns in input="genasis"
are not rigid, only their order is assumed. There is also a possibility to specify x
and y
as two vectors of equal lenght, first of class "numeric"
or "character"
containing concentration values, second of class "character"
or "Date"
containing measurement dates.
The output
argument specifies of which type the result will be. Both types of "data.frame"
class output="openair"
and output="genasis"
are available - now without any exceptions with all concentration values of class "numeric"
, the default value is equal to the input
argument, therefore the vector class of output is possible only if x
is "numeric"
or "character"
vector and output
is not specified.
There are five available methods of LoQs treatment. The simpliest method method="exc"
is not recommended because of high bias and meaningless approach. Standard constant methods method="1.0"
, method="2.0"
and method="sq2"
serve for substitution of (concentration) values below LoQ by value of LoQ divided gradually by 1 ,2 and square root of 2. The most recommended is the modified maximum likelihood method method="mle"
which will be described later.
a list containing:
res |
the data frame (or vector) according to the |
loq |
numeric value of LoQ |
Jiri Kalina
kalina@mail.muni.cz
genoutlier, genhistogram, genpastoact, genanaggr,
genplot, genstatistic, gentransform, genwhisker
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Definition of simple data sources:
c1<-rlnorm(100,0,1)
c2<-"random compound"
c3<-as.Date(as.Date("2013-01-01"):as.Date("2013-04-10"),
origin="1970-01-01")
c4<-c3+1
# Cuts the values below the 0.5.
c1[which(c1<0.5)]<-"LoQ"
sample_genasis<-data.frame(c1,c2,c3,c4)
sample_openair<-data.frame(c4,c1)
colnames(sample_openair)=c("date",c2)
## Examples of different usages:
genloq(c1,c3,pollutant=c2,method="sq2")
genloq(sample_openair,method="mle")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.