Skip to contents

Plot a climate stripes graph for a station.

Usage

climatestripes_station(
  station,
  start = 1950,
  end = 2020,
  with_labels = "yes",
  verbose = FALSE,
  ...
)

Arguments

station

Character string with station identifier code(s). See aemet_stations().

start

Numeric value with the start year (format: YYYY).

end

Numeric value with the end year (format: YYYY).

with_labels

Character string, either "yes" or "no", to indicate whether plot labels are displayed.

verbose

Logical. If TRUE, provides information about the flow of information between the client and server.

...

Arguments passed on to ggstripes

n_temp

Numeric value with the number of colors of the palette. (default 11).

col_pal

Character string indicating the name of the hcl.pals() color palette to be used for plotting.

Value

A ggplot2 object. See help("ggplot2").

Note

"Warming stripes" charts are a conceptual idea of Professor Ed Hawkins (University of Reading) and are specifically designed to be as simple as possible and to warn about climate change risks. For more details, see ShowYourStripes.

API key

You need to set your API key globally using aemet_api_key(). Query timeout can be controlled with options(climaemet_timeout = 60) (default value). See httr2::req_timeout() for details.

Examples

# \donttest{

# Do not run this example.
if (FALSE) {
  # Downloading data may take a few minutes.
  climatestripes_station(
    "9434",
    start = 2020,
    end = 2024,
    with_labels = "yes",
    col_pal = "Inferno"
  )
}
# }