Learn R Programming

CDSim (version 0.1.1)

simulate_climate_series: Simulate monthly climate time series for stations

Description

Simulate monthly Tmin, Tmax, monthly total rainfall (Sum.Rf) and mean daily rainfall (Avg.Rf) for each station across a year range.

Usage

simulate_climate_series(
  stations,
  start_year = 1981,
  end_year = 2020,
  seed = NULL
)

Value

A tidy data.frame with one row per station × month containing: Station, LON, LAT, Year, Month, Date, Avg.Tn, Avg.Tx, Sum.Rf, Avg.Rf

Arguments

stations

data.frame from create_stations() (Station, LON, LAT)

start_year

integer (e.g., 1981)

end_year

integer (e.g., 2020)

seed

optional numeric seed

Details

This function simulates synthetic time-series climate data based on...

See Also

write_station_csv(), write_station_netcdf()

Examples

Run this code
st <- create_stations(n = 3, seed = 1)
sim <- simulate_climate_series(st, 1981, 1982, seed = 42)
head(sim)

Run the code above in your browser using DataLab