Skip to contents

Flatten climatology outputs (list of SpatRaster) to a tidy data.frame

Usage

as_climatology_df(
  input,
  vars = NULL,
  xy = TRUE,
  rename_xy = TRUE,
  missing_dhw = c("preserve", "zero")
)

Arguments

input

List with SpatRaster elements such as sst, climatology, anomaly, hotspots, and dhw.

vars

character vector of element names to extract and join (defaults to c("sst","climatology","anomaly","hotspots","dhw") present in x)

xy

Include spatial coordinates.

rename_xy

Rename coordinate columns from x, y to lon, lat.

missing_dhw

How missing DHW values are represented. The default, "preserve", retains missing and incomplete history. Use "zero" only for legacy workflows that explicitly require it.

Value

tibble with columns: lon, lat, time, and one column per var in vars