Description Usage Arguments Details Value Author(s) See Also Examples
Function genplot
allows to draw points of time series of persistent organic pollutant concentration. Several parametric and non-parametric interlacing curves are available and optional (linear and exponential) and three possibilities of drawing confidence interval of the trend line (none, one-coloured and gradient).
1 2 3 4 5 |
x |
vector of concentration values or data frame of genasis/openair type. See 'Details' for more detailed description of both data types. |
y |
vector of measurement dates in the case of vector input only. |
input |
type of data.frame in the case of data.frame input. The allowed values are |
pollutant |
name of the pollutant(s), for which the plot is plotted. Not necessary if only data for one pollutant is available in |
plot |
logical. Indicates, whether plot should be plotted. |
xlim |
|
ylim |
numeric vector of length 2, giving the y axis coordinates ranges. |
n |
number of breaks of interlacing line. If not specified, |
col |
color of interlacing line and confidence interval area, if chosen. |
col.points |
color of points inside the plot. |
pch |
plotting "character", i.e., symbol to use. For more details see points. |
il |
type of the interlacing curve. Value |
distr |
shape of the interlacing curve. Value |
ci |
indicates, whether confidence interval of interlacing curve should be plotted. The allowed values are |
r |
significance level of the confidence interval as a positive number between 0 and 1. |
columns |
number of columns in the multi-plot arrangement. |
xlab |
the x label of the plot. |
ylab |
the y label of the plot. |
main |
overall title for the plot. |
The genplot
function enables to draw a plot of concentration time series. The function recognises three different input formats: Option input="openair"
uses openair format of data frame with first column of name "date"
and type Date, optional columns of names "date_end"
, "temp"
, "wind"
and "note"
and other columns of class "numeric"
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, 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"
containing concentration values, second of class "character"
or "Date"
containing measurement dates.
In all cases of input, if both start and end date are given, the date point is plotted as a middle of measurement period, if only one date is given, it is used directly.
There are two options for plotting interlacing line of concentrations. distr="lnorm"
(default) expects lognormal distribution and plots exponential trend, while distr="norm"
expects roughly normal distribution of concentration data and plots linear trend.
Two methods of interlacing are available under the argument il
. il="ls"
(default) deploys least squares method, while il="ts"
deploys the Theil-Sen linear (or log-transformed exponential) estimator.
Confidence intervals of trend lines are also available by the option ci
with available values TRUE
(default) for one-coluored area, "gradient"
for probability gradient and FALSE
for no confidence interval to be drawn. The default significance level of the confidence interval r
is set up to 0.95
.
Default values of col
and col.points
parameters to specify colours of regression line and points in the plot are set up to #A52375
and black, default shape of points pch
is set up to standard circles (1).
In a case of multiple pollutants specified, the argument columns
specifies the number of columns in resulting table of plots. Be careful with plotting higher numbers of plots - usual devices are not large enough to plot more than four plots at once, there is a need to set up sufficiently high and broad space for plotting inside the device settings.
Main label and axes labels could be specified in main
, xlab
and ylab
. A name of the pollutant is added after the user-set up label. If no specification is given, the name of the pollutant is used in main and "Date" and "Concentration" in axes labels.
a list containing:
|
slope of the regression line (in the case of exponential line, it is in a form of exponent of exp(x)). |
|
slope of the regression line (in the case of exponential line, it is in a form of multiplicative constant). |
|
x-coordintaes (as |
|
y-coordintaes (concentration as |
|
y-coordintaes (as |
|
y-coordintaes (as |
Jiri Jarkovsky
Jiri Kalina
kalina@mail.muni.cz
genloq, genoutlier, genhistogram, genpastoact,
genanaggr, genstatistic, gentransform, genwhisker
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Definition of simple data sources:
c1<-c(0.386,0.256,0.182,0.254)
c2<-"fluorene"
c3<-c("2013-05-01","2013-06-03","2013-07-05","2013-08-07")
c4<-c("2013-05-08","2013-06-10","2013-07-12","2013-08-14")
sample_genasis<-data.frame(c1,c2,c3,c4)
sample_openair<-data.frame(c4,c1)
colnames(sample_openair)=c("date","fluorene")
## Examples of different usages:
genplot(sample_openair,input="openair",pollutant="fluorene",distr="lnorm",
n=10,ci="gradient",col="black",col.points="red",pch=15)
genplot(sample_genasis,input="genasis",n=10,col="blue")
genplot(c1,c3,ci=FALSE,pch=1,main="fluorene")
## Use of example data from the package:
data(kosetice.pas.openair)
genplot(kosetice.pas.openair[,1:8],col="orange",il="ts",ci=FALSE)
data(kosetice.pas.genasis)
## Not run: genplot(kosetice.pas.genasis[1:208,],input="genasis",
distr="lnorm",ci="gradient",col="orange")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.