get_events: Get onset, diapause or mortality

get_onset_rstR Documentation

Get onset, diapause or mortality

Description

Get onset, diapause or mortality as day of year or raw output. Note that multiple mortality events are possible over the season.

Usage

get_onset_rst(pheno, as_doy = TRUE, dates = prop_dates(pheno))

get_onset_df(
  pheno,
  stations = prop_stations(pheno),
  as_doy = TRUE,
  dates = prop_dates(pheno)
)

get_diapause_rst(pheno, as_doy = TRUE, dates = prop_dates(pheno))

get_diapause_df(
  pheno,
  stations = prop_stations(pheno),
  as_doy = TRUE,
  dates = prop_dates(pheno)
)

get_mortality_rst(pheno, as_doy = TRUE, dates = prop_dates(pheno))

get_mortality_df(
  pheno,
  stations = prop_stations(pheno),
  as_doy = TRUE,
  dates = prop_dates(pheno)
)

Arguments

pheno

A phenology (see phenology())

as_doy

If TRUE, the day(s) of year will be returned. If FALSE the phenological events will be returned in a raw format. Then, the return value could be used as input for phenology()/bso_phenology() (parameters .onset, .diapause and .mortality).

dates

Select dates that should be present in the output.

stations

Pass a character vector to choose stations assigned to pheno by their names, or pass different stations. See stations_create() for details.

Value

  • get_onset_rst(), get_diapause_rst(), get_mortality_rst(): A (multi-layer) SpatRaster.

  • get_onset_df(), get_diapause_df(), get_mortality_df(): A data frame.

Functions

  • get_onset_rst(): Returns a (multi-layer) SpatRaster of the onset.

  • get_onset_df(): Returns a data frame of the onset.

  • get_diapause_rst(): Returns a (multi-layer) SpatRaster of the diapause.

  • get_diapause_df(): Returns a data frame of the diapause.

  • get_mortality_rst(): Returns a (multi-layer) SpatRaster of the mortality.

  • get_mortality_df(): Returns a data frame of the mortality.

Examples


# calculate phenology
p <- phenology('phenips-clim', barrks_data(), .quiet = TRUE)

# plot onset, diapause, mortality
get_onset_rst(p) |> terra::plot()
get_diapause_rst(p) |> terra::plot()
get_mortality_rst(p)[[1]] |> terra::plot()





barrks documentation built on April 3, 2025, 9:47 p.m.