plotFun.ts.orig: Plot time series.

plotFun.ts.origR Documentation

Plot time series.

Description

Plot a time series plot, with the possibility of applying a temporal aggregation (see data_agg).

Usage

plotFun.ts.orig(data, dates, hour = FALSE, agg = NULL,
  aggFun = "mean", season = NULL, output.data = FALSE,
  stn.together = FALSE, col.lines = rainbow(10), title = NULL,
  input.mch = FALSE)

Arguments

data

Matrix with the data to be plotted (time steps in rows, stations in columns). The column names are used for labels in the plot, otherwise a,b,c,... are used.

dates

Vector of dates (POSIX class) of the original data.

hour

logical. Is the input data hourly? Hourly data can only use aggregation 'D'. Default: FALSE.

agg

Level of temporal aggregation: daily ("D", only for hourly input data), monthly ("M"), seasonal ("S"), annual ("Y"). Default: NULL (all data is plotted using the original temporal resolution). This argument is only valid for type="ts".

aggFun

Function for temporal aggregation, if desired. Possible values: mean, median, min, max. Default: mean.

season

Vector with the desired month (season) to be plotted, e.g. 8 is August, c(6,7,8) is JJA, with the operation of 'aggFun'. Default: NULL (no seasonal/monthly slice considered).

output.data

Logical, return plotted data or not. Default: FALSE.

stn.together

Logical, set to TRUE to plot all stations with colour lines in one plot. Default: FALSE. Only available for time series plots.

col.lines

Vector with colours for lines. Only available for time series plots.

title

character string with the main title. A 1-element vector would set the same title to all subplots, a n-element vector would have the titles for n subplots.

input.mch

logical. If the input data is from DWH, the hourly needs to be aggregated differently. See data_agg. Default: FALSE

Details

Plot time series of one vector. It is possible to plot the "raw" series or aggregate it temporarily or display a specific season/month. If the input data is a matrix, by default a separate panel is obtained for each station. 'stn.together' allows to plot all stations together (without subplot).

Value

A time series plot. Plotted data if 'output.data'=TRUE. The result is a list with the aggregated data, aggregated dates, function and type of aggregation.


anacv/plotFun documentation built on June 21, 2022, 10:31 p.m.