Takes a data.frame of yearly stand properties, trims/extends the columns height, maxlai, sai, densef, and age for the years in out_yrs, and updates the provided parameter list.

standprop_yearly_to_param(standprop_yearly, param_b90, out_yrs)

Arguments

standprop_yearly

A data.frame or data.table with columns 'year', 'height', 'maxlai', 'sai', 'densef', 'age'.

param_b90

A list object to update.

out_yrs

Vector of years for which parameters should be updated.

Value

The param_b90 list-object with updated items maxlai, height, height_ini, sai, sai_ini, densef, densef_ini, age, age_ini.

Examples

param_b90 <- set_paramLWFB90()
dat <- slb1_standprop

years <- 2002:2005
param.new <- standprop_yearly_to_param(dat,
                                       param_b90,
                                       years)

identical(param.new$maxlai, dat$maxlai[dat$year %in% years])
#> [1] TRUE
identical(param.new$height, dat$height[dat$year %in% years])
#> [1] TRUE