
Assemble LANDIS-II Climate Library wide-format table from a climr Arrow dataset
assemble_climate_library_file_monthly_climr.RdReads the partitioned Arrow CSV dataset written by
get_clim_monthly_climr(), joins per-cell rows to ecoregion ids via
eco_lookup, summarises by (Year, Month, EcoID, Variable) with
mean(..., na.rm = TRUE), applies unit conversions to match LANDIS-II
conventions, and pivots to wide format keyed by ecoregion id.
Arguments
- dataset_path
character. Path to a scenario-tagged
Climr_MonthlyArrow dataset directory (containingVariable=.../Year=.../... partitions). Typically<cache_root>/Climr_Monthly/<sa_hash>/<scenario_tag>.- vars
character vector of lowercase variable names (e.g.
c("prcp", "tmax", "tmin")); same set accepted byprep_monthly_weather_climr().- eco_lookup
data.framewith columnsid(cell id, matching theidcolumn in the cached partitions) andEcoID(ecoregion id from the study-areaidfield). Typically built by.climr_build_xyz()(internal).
Details
For projection-mode partitions (which carry extra GCM and SSP columns),
the same group-and-mean step collapses across GCMs/SSPs/cells, yielding a
single multi-GCM ensemble-mean value per (Year, Month, EcoID, Variable)
as expected by the LANDIS-II Climate Library.
Unit conversions applied:
PPT(mm) \(\to\) cm (\(\div 10\))