| timeProp | R Documentation |
This function shows time series plots as stacked bar charts. The different
categories in the bar chart are made up from a character or factor variable
in a data frame. The function is primarily developed to support the plotting
of cluster analysis output from polarCluster() and trajCluster() that
consider local and regional (back trajectory) cluster analysis respectively.
However, the function has more general use for understanding time series
data.
timeProp(
mydata,
pollutant = "nox",
proportion = "wd",
avg.time = "day",
type = "default",
cols = "Set1",
normalise = FALSE,
x.relation = "same",
y.relation = "same",
key.columns = 1,
key.position = "right",
key.title = proportion,
strip.position = "top",
date.breaks = 7,
date.format = NULL,
auto.text = TRUE,
plot = TRUE,
key = NULL,
...
)
mydata |
A data frame containing the fields |
pollutant |
Name of the pollutant to plot contained in |
proportion |
The splitting variable that makes up the bars in the bar
chart, defaulting to |
avg.time |
This defines the time period to average to. Can be Note that |
type |
Character string(s) defining how data should be split/conditioned
before plotting.
Most |
cols |
Colours to use for plotting. Can be a pre-set palette (e.g.,
|
normalise |
If |
x.relation, y.relation |
This determines how the x- and y-axis scales are
plotted. |
key.columns |
Number of columns to be used in a categorical legend. With
many categories a single column can make to key too wide. The user can thus
choose to use several columns by setting |
key.position |
Location where the legend is to be placed. Allowed
arguments include |
key.title |
Used to set the title of the legend. The legend title is
passed to |
strip.position |
Location where the facet 'strips' are located when
using |
date.breaks |
Number of major x-axis intervals to use. The function will
try and choose a sensible number of dates/times as well as formatting the
date/time appropriately to the range being considered. The user can
override this behaviour by adjusting the value of |
date.format |
This option controls the date format on the x-axis. A
sensible format is chosen by default, but the user can set |
auto.text |
Either |
plot |
When |
key |
Deprecated; please use |
... |
Addition options are passed on to
|
In order to plot time series in this way, some sort of time aggregation is
needed, which is controlled by the option avg.time.
The plot shows the value of pollutant on the y-axis (averaged according to
avg.time). The time intervals are made up of bars split according to
proportion. The bars therefore show how the total value of pollutant is
made up for any time interval.
an openair object
David Carslaw
Jack Davison
Other time series and trend functions:
TheilSen(),
calendarPlot(),
smoothTrend(),
timePlot(),
timeVariation()
Other cluster analysis functions:
polarCluster(),
trajCluster()
# monthly plot of SO2 showing the contribution by wind sector
timeProp(mydata, pollutant = "so2", avg.time = "month", proportion = "wd")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.