Create a time series plot showing how plankton indices vary over time at different stations or bioregions. This is a simple line plot without trend analysis or aggregation.

pr_plot_TimeSeries(df, trans = "identity")

Arguments

df

A dataframe from pr_get_Indices() containing timeseries data

trans

Transformation for the y-axis scale. Options include:

  • "identity" - No transformation (default)

  • "log10" - Log base 10 transformation (useful for abundance data)

  • "sqrt" - Square root transformation

  • "log" - Natural log transformation

  • Any other transformation accepted by ggplot2::scale_y_continuous()

Value

A ggplot2 object showing the timeseries

Details

For NRS data, values are averaged across depths if multiple depths are present (relevant for microbial data). For CPR data, bioregions are treated as "stations" for plotting purposes.

The plot uses colour and line type to distinguish between stations/bioregions. Points show individual observations, connected by lines.

See also

pr_plot_Trends() for timeseries with trend lines, pr_plot_Climatology() for seasonal patterns

Examples

# Plot NRS zooplankton biomass
df <- pr_get_Indices("NRS", "Zooplankton") %>%
  dplyr::filter(Parameters == "Biomass_mgm3", StationCode %in% c("NSI", "PHB"))
pr_plot_TimeSeries(df)
#> Warning: Removed 6 rows containing missing values or values outside the scale range
#> (`geom_line()`).
#> Warning: Removed 13 rows containing missing values or values outside the scale range
#> (`geom_point()`).


# Use log scale for abundance data
df <- pr_get_Indices("NRS", "Phytoplankton") %>%
  dplyr::filter(Parameters == "PhytoAbundance_CellsL", StationCode %in% c("MAI", "PHB"))
pr_plot_TimeSeries(df, trans = "log10")
#> Warning: Removed 6 rows containing missing values or values outside the scale range
#> (`geom_line()`).
#> Warning: Removed 17 rows containing missing values or values outside the scale range
#> (`geom_point()`).