Skip to contents

Modify dates in a climate4R object

Usage

modifyDates(x, start_date = "1961-01-01", end_date = "1990-12-31")

Arguments

x

A climate4R object as loaded by loadUerra(), loadCMIP5(), loadTrace(), or loadeR::loadGridData() functions.

start_date

A character string with the new starting date in the format "yyyy-mm-dd".

end_date

A character string with the new ending date in the format "yyyy-mm-dd".

Value

The function returns the same climate4R object with modified dates according to the new start and end dates.

Details

Because the dsclim package is designed to work and downscale monthly meteorological data, the function automatically create a vector of monthly dates from the new start to the new end dates. This new vector of dates should have the same length as the dates in the x object. Otherwise, it will through an error.

Examples

if (FALSE) { # \dontrun{
uerra <- dsclim::loadUerra(
  "Data/UERRA/UERRA-HARMONIE/2m_temperature/latlon/1961-90_2m_temperature.nc",
  "tas"
)

modifyDates(uerra, "1901-01-01", "1930-12-31")
} # }