- mydata
A data frame of hourly (or higher temporal resolution data).
Must include a date
field and at least one variable to plot.
- pollutant
Name of variable to plot. Two or more pollutants can be
plotted, in which case a form like pollutant = c("nox", "co")
should
be used.
- local.tz
Should the results be calculated in local time that includes
a treatment of daylight savings time (DST)? The default is not to consider
DST issues, provided the data were imported without a DST offset. Emissions
activity tends to occur at local time e.g. rush hour is at 8 am every day.
When the clocks go forward in spring, the emissions are effectively
released into the atmosphere typically 1 hour earlier during the summertime
i.e. when DST applies. When plotting diurnal profiles, this has the effect
of “smearing-out” the concentrations. Sometimes, a useful approach
is to express time as local time. This correction tends to produce
better-defined diurnal profiles of concentration (or other variables) and
allows a better comparison to be made with emissions/activity data. If set
to FALSE
then GMT is used. Examples of usage include local.tz
= "Europe/London"
, local.tz = "America/New_York"
. See
cutData
and import
for more details.
- normalise
Should variables be normalised? The default is FALSE
.
If TRUE
then the variable(s) are divided by their mean values. This
helps to compare the shape of the diurnal trends for variables on very
different scales.
- xlab
x-axis label; one for each sub-plot.
- name.pol
Names to be given to the pollutant(s). This is useful if you
want to give a fuller description of the variables, maybe also including
subscripts etc.
- type
type
determines how the data are split i.e. conditioned,
and then plotted. The default is will produce a single plot using the
entire data. Type can be one of the built-in types as detailed in
cutData
e.g. “season”, “year”, “weekday” and so
on. For example, type = "season"
will produce four plots --- one for
each season.
It is also possible to choose type
as another variable in the data
frame. If that variable is numeric, then the data will be split into four
quantiles (if possible) and labelled accordingly. If type is an existing
character or factor variable, then those categories/levels will be used
directly. This offers great flexibility for understanding the variation of
different variables and how they depend on one another.
Only one type
is allowed intimeVariation
.
- group
This sets the grouping variable to be used. For example, if a
data frame had a column site
setting group = "site"
will plot
all sites together in each panel. See examples below.
- difference
If two pollutants are chosen then setting difference
= TRUE
will also plot the difference in means between the two variables as
pollutant[2] - pollutant[1]
. Bootstrap 95\
the difference in means are also calculated. A horizontal dashed line is
shown at y = 0. The difference can also be calculated if there is a column
that identifies two groups e.g. having used splitByDate
. In this
case it is possible to call timeVariation
with the option
group = "split.by"
and difference = TRUE
.
- statistic
Can be “mean” (default) or “median”. If the
statistic is ‘mean’ then the mean line and the 95\
interval in the mean are plotted by default. If the statistic is
‘median’ then the median line is plotted together with the 5/95 and
25/75th quantiles are plotted. Users can control the confidence intervals
with conf.int
.
- conf.int
The confidence intervals to be plotted. If statistic =
"mean"
then the confidence intervals in the mean are plotted. If
statistic = "median"
then the conf.int
and 1 -
conf.int
quantiles are plotted. conf.int
can be of length 2,
which is most useful for showing quantiles. For example conf.int =
c(0.75, 0.99)
will yield a plot showing the median, 25/75 and 5/95th
quantiles.
- B
Number of bootstrap replicates to use. Can be useful to reduce this
value when there are a large number of observations available to increase
the speed of the calculations without affecting the 95\
interval calculations by much.
- ci
Should confidence intervals be shown? The default is TRUE
.
Setting this to FALSE
can be useful if multiple pollutants are
chosen where over-lapping confidence intervals can over complicate plots.
- cols
Colours to be used for plotting. Options include
“default”, “increment”, “heat”, “jet” and
RColorBrewer
colours --- see the openair
openColours
function for more details. For user defined the user can supply a list of
colour names recognised by R (type colours()
to see the full list).
An example would be cols = c("yellow", "green", "blue")
- ref.y
A list with details of the horizontal lines to be added
representing reference line(s). For example, ref.y = list(h = 50, lty
= 5)
will add a dashed horizontal line at 50. Several lines can be plotted
e.g. ref.y = list(h = c(50, 100), lty = c(1, 5), col = c("green",
"blue"))
. See panel.abline
in the lattice
package for more
details on adding/controlling lines.
- key
By default timeVariation
produces four plots on one page.
While it is useful to see these plots together, it is sometimes necessary
just to use one for a report. If key
is TRUE
, a key is added
to all plots allowing the extraction of a single plot with key. See
below for an example.
- key.columns
Number of columns to be used in the key. With many
pollutants a single column can make to key too wide. The user can thus
choose to use several columns by setting columns
to be less than the
number of pollutants.
- start.day
What day of the week should the plots start on? The user can
change the start day by supplying an integer between 0 and 6. Sunday = 0,
Monday = 1, ... For example to start the weekday plots on a Saturday,
choose start.day = 6
.
- panel.gap
The gap between panels in the hour-day plot.
- auto.text
Either TRUE
(default) or FALSE
. If TRUE
titles and axis labels will automatically try and format pollutant names
and units properly e.g. by subscripting the ‘2’ in NO2.
- alpha
The alpha transparency used for plotting confidence intervals. 0
is fully transparent and 1 is opaque. The default is 0.4
- month.last
Should the order of the plots be changed so the plot
showing monthly means be the last plot for a logical hierarchy of averaging
periods?
- plot
Should a plot be produced? FALSE
can be useful when
analysing data to extract plot components and plotting them in other ways.
- ...
Other graphical parameters passed onto lattice:xyplot
and
cutData
. For example, in the case of cutData
the option
hemisphere = "southern"
.