plot_monthly_heatmap: Monthly Pollen Heatmap

View source: R/plot_monthly_heatmap.R

plot_monthly_heatmapR Documentation

Monthly Pollen Heatmap

Description

Function to plot monthly sums of daily pollen concentrations as a heatmap. Months are displayed in the x axis and years in the y axis for one selected pollen type.

Usage

plot_monthly_heatmap(
  data,
  pollen.type,
  location = NULL,
  location.col = NULL,
  start.month = 1,
  color.A = "yellow",
  color.B = "red",
  result = "plot"
)

Arguments

data

A data.frame object. The first column must be in Date format and pollen types must be provided as numeric columns. If the data include several locations, one column can identify the location.

pollen.type

A character string with the name of the pollen type to be plotted. This name must match one numeric column in data.

location

A character string with the location to be selected. If NULL and a location column is detected, the first location in the data is used. If the data do not include a location column, this argument is ignored.

location.col

A character string with the name of the column containing the locations. If NULL, common names such as "location", "city" or "station" are automatically detected.

start.month

A numeric value ranging 1_12 specifying the first month shown in the x axis. The start.month argument will be 1 by default.

color.A

A character object with the specification of the color of the lowest value for the scale. By default, color.A = "yellow".

color.B

A character object with the specification of the color of the highest value for the scale. By default, color.B = "red".

result

A character object with the definition of the object to be produced by the function. If result == "plot", the function returns an object of class ggplot2; if result == "table", the function returns a data.frame with the monthly sums. By default, result = "plot".

Value

If result == "plot", the function returns an object of class ggplot2; if result == "table", the function returns a data.frame with the monthly sums.

Examples

data("munich_pollen")
plot_monthly_heatmap(munich_pollen, pollen.type = "Betula")
plot_monthly_heatmap(munich_pollen, pollen.type = "Poaceae", start.month = 6)

AeRobiology documentation built on July 10, 2026, 1:06 a.m.