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
make_chill_plot(
chill,
model,
start_year = NA,
end_year = NA,
metriclabel = NULL,
yearlabel = "End_year",
misstolerance = 10,
image_type = NA,
outpath = NA,
filename = NA,
fonttype = "serif",
plotylim = NA,
plottitle = NULL
)
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)
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.)
the name of the column of the chill object that contains the metric to be displayed
the first year shown in the diagram. Default to NA, which means the first date on record is used as start_year.
the last year shown in the diagram. Default to NA, which means the last date on record is used as end_year.
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.
character string indicating the name of the column in the chill object that is to be used for the time axis.
Percentage of missing values that leads to exclusion of an annual value from plotting.
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.
Path to the folder where the images should be saved. Should include a trailing "/".
Suffix of the filenames for output graph files. These will be amended by the name of the metric and by the file extension.
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.
numeric vector of length 2 indicating the extent of the y axis. Defaults to NA, which means that y limits are determined automatically.
character string indicating the plot title. Defaults to NULL for no title.
Eike Luedeling
Plots climatic metrics computed with chilling or tempResponse, indicating the completeness of the temperature record by shades of gray.
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")
Run the code above in your browser using DataLab