make_chill_plot: Plot climate metrics over time

Description Usage Arguments Details Value Author(s) Examples

View source: R/make_chill_plot.R

Description

This function generates a plot of a climate metric over multiple years, including an indication of data quality, i.e. the share of missing values. Output can be either an R plot or a .png image

Usage

1
2
3
make_chill_plot(chill, model, start_year = 1990, end_year = 2020,
  metriclabel = NULL, misstolerance = 10, image_type = NA, outpath = NA,
  filename = NA, fonttype = "serif")

Arguments

chill

a chill object generated either with the chilling function or with tempResponse. For this function to work properly, the chill object should have been subjected to quality control (i.e. metrics should have been calculated from weather records with a QC element. If you prepare weather data with fix_weather, this should work.)

model

the name of the column of the chill object that contains the metric to be displayed

start_year

the first year shown in the diagram. Note that the default is 1950, and the function does not automatically remove years for which there is no data.

end_year

the last year shown in the diagram. Note that the default is 2020, and the function does not automatically remove years for which there is no data.

metriclabel

character string that can be used for labeling the y-axis in the plot. If this is not specified, the function will use the model argument.

misstolerance

Percentage of missing values that leads to exclusion of an annual value from plotting.

image_type

Character string indicating the file format that should be output. Image files are only produced for the moment, if this is "png". All other values, as well as the default NA lead to output as an R plot only.

outpath

Path to the folder where the images should be saved. Should include a trailing "/".

filename

Suffix of the filenames for output graph files. These will be amended by the name of the metric and by the file extension.

fonttype

The type of font to be used for the figures. Can be 'serif' (default) for a Times New Roman like font, 'sans' for an Arial type font or 'mono' for a typewriter type font.

Details

Plots climatic metrics computed with chilling or tempResponse, indicating the completeness of the temperature record by shades of gray.

Value

only a side effect - plot of climate metric over time; bars are color coded according to the number of missing values. Bars with numbers of missing values above the misstolerance are not show and instead marked '*' (to distinguish them from 0 counts)

Author(s)

Eike Luedeling

Examples

1
2
3
4
make_chill_plot(tempResponse(stack_hourly_temps(fix_weather(KA_weather[KA_weather$Year>2005,]))),
"Chill_Portions",start_year=1990,end_year=2010,metriclabel="Chill Portions")

 

chillR documentation built on May 30, 2017, 6:57 a.m.