gsodPlot: Plot GSOD data

View source: R/gsodPlot.R

gsodPlotR Documentation

Plot GSOD data

Description

This function aims at visualizing GSOD data, both raw/adjusted for outliers and imputed, as well as linear trends of mean, minimum and maximum daily air temperature.

Usage

gsodPlot(
  fls_orig = NULL,
  fls,
  stations,
  prm = "TEMP",
  type = c("original", "trends", "both"),
  ...
)

Arguments

fls_orig

See argument fls.

fls

Character vector containing filepath(s) to the imputed GSOD data set(s), usually derived from gfLinInt, gfJulendat and/or gfSsa, or list containing data.frame objects holding the data, or a single data.frame in case only one GSOD station shall be visualized.

stations

Character. Name(s) of the station(s) corresponding to fls and fls_orig that will be displayed above each facet.

prm

Character, default is "TEMP". Determines which parameter to visualize. If type = "trends", this argument will be ignored, and columns "TEMP", "MIN" and "MAX" must be available in fls and fls_orig.

type

Character. Determines the plot type, one of "original" (default), "trend", or "both".

...

Additional arguments passed to element_text.

Value

An object of class ggplot.

Author(s)

Florian Detsch

Examples

# Visualize trends in daily mean, minimum, and maximum air temperature
lst = split(
  eastafrica
  , f = paste(
    eastafrica$PlotId
    , eastafrica$Status
    , sep = ","
  )
)

cleansed_data = lst[
  grep(
    "cleansed"
    , names(lst)
  )
]

filled_data = lst[
  grep(
    "filled"
    , names(lst)
  )
]

gsodPlot(
  cleansed_data
  , filled_data
  , stations = c("NAIROBI JKIA", "KILIMANJARO INTL")
  , type = "trends"
)


environmentalinformatics-marburg/GSODTools documentation built on Jan. 5, 2024, 12:19 a.m.