View source: R/growingDegreeDay.R
get_layer_indice | R Documentation |
Compute a vector of indices of "year" or "month" based on the date extracted from the SpatRaster or a vector of strings over the time period.
get_layer_indice(
x = NULL,
pattern = NULL,
date_format = "%Y-%m-%d",
indice_level = "year",
week_start = getOption("lubridate.week.start", 1)
)
x |
SpatRaster or a vector of dates, from which to extract the dates of the time-series. |
pattern |
string or characters to remove from the date name (e.g. remove the character "X" from "X2001.07.15"), default is null. |
date_format |
format of the date |
indice_level |
string to define the time-period to use to define the indices, "year" or "month". |
week_start |
option of lubridate starting day of the week, where 1 is Monday and 7 is Sunday. |
This function generate a vector of indices dividing the time-series in years or months. This indices are use for the calculating the cummulative sum over years or month (see function cumsum_rb()).
Reto Schmucki
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.