prepare_climate {r3PG} | R Documentation |
Subsets or replicate a climate data
Description
Prepares the climate table, by either replicating the average climate for the required number of years, or by sub-setting from a longer time-series of climate data.
Usage
prepare_climate(climate, from = "2000-04", to = "2010-11")
Arguments
climate |
table containing the information about monthly values for climatic data. If the climate table have exactly 12 rows it will be replicated for the number of years and months specified by
|
from |
year and month indicating the start of simulation. Provided in form of year-month. E.g. "2000-01". |
to |
year and month indicating the end of simulation. Provided in form of year-month. E.g. "2009-12", will include December 2009 as last simulation month. |
Details
This function prepares the climate table for run_3PG
.
In case a user provides only average climate, this is replicated for the desired simulation period.
In case a larger climate file is provided, the simulation period is selected from this.
Value
a data.frame with number of rows corresponding to number of simulated month and 10 columns
See Also
run_3PG
, prepare_input
, prepare_parameters
, prepare_sizeDist
, prepare_thinning
Examples
# sub-setting climate data
prepare_climate( climate = d_climate, from = '2003-04', to = '2010-11')
# replicating climate data
set.seed(1)
climate = data.frame( tmp_min = rnorm(12, mean = 10),
tmp_max = rnorm(12, mean = 20),
prcp = sample(c(0:200), 12),
srad = sample(c(1:100), 12),
frost_days = sample(c(0:30), 12))
prepare_climate( climate = climate, from = '2000-04', to = '2010-11')