Creates highly customizable climate time-series visualizations with automatic seasonal detection.

Supports:

  • Custom line colors

  • Seasonal coloring

  • LOESS smoothing

  • Trend lines

  • Dark/light themes

  • Flexible date handling

  • Faceting

plot_station_timeseries(
  df,
  station,
  var = "Tmin",
  smooth = TRUE,
  smooth_span = 0.25,
  show_points = TRUE,
  point_size = 2,
  line_size = 1,
  line_color = NULL,
  smooth_color = NULL,
  seasonal_colors = NULL,
  use_season_colors = TRUE,
  alpha = 0.8,
  theme_style = c("minimal", "dark", "classic", "bw"),
  date_breaks = "2 years",
  date_labels = "%Y",
  facet = FALSE,
  show_trend = FALSE,
  trend_color = "black",
  title = NULL,
  subtitle = NULL
)

Arguments

df

Climate dataframe.

station

Station name.

var

Climate variable to plot.

smooth

Logical. Add LOESS smoothing line.

smooth_span

LOESS span parameter.

show_points

Logical. Show points on plot.

point_size

Point size.

line_size

Line width.

line_color

Main line color.

smooth_color

Smoothing line color.

seasonal_colors

Named vector of colors.

use_season_colors

Logical. Color points by season.

alpha

Transparency level.

theme_style

Plot theme. Options are: "minimal", "dark", "classic", "bw".

date_breaks

X-axis date interval.

date_labels

Date label format.

facet

Logical. Facet by season.

show_trend

Logical. Add linear trend line.

trend_color

Trend line color.

title

Plot title.

subtitle

Plot subtitle.

Value

A ggplot object.

Examples

if (FALSE) { # \dontrun{

plot_station_timeseries(
  climate_data,
  station = "Station_1",
  var = "Tmin"
)

} # }