run_model: 'tidyverse' implementation of the IPCC (2019) steady-state...

Description Usage Arguments Examples

View source: R/run_model.R

Description

Takes a tibble containing model input data and returns the same tibble with soil carbon stocks estimated. For input data, see toy_input for example; run stoy_input for variable interpretation and units.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
run_model(
  data,
  runin_dur = 10,
  drop_prelim = TRUE,
  drop_runin = TRUE,
  calculate_climfacs = TRUE,
  year = "year",
  tfac = "tfac",
  wfac = "wfac",
  climdata = "climdata",
  temp = "temp",
  precip = "precip",
  pet = "pet",
  c_input = "c_input",
  lignin_frac = "lignin_frac",
  n_frac = "n_frac",
  sand_frac = "sand_frac",
  till_type = "till_type",
  params = soilc_params
)

Arguments

data

A tibble containing model input data.

runin_dur

An integer value specifying the number of rows to enter into the run-in calculation. Defaults to 10 years.

drop_prelim

A logical indicating whether preliminary calculation results should be dropped from the returned tibble. Defaults to TRUE.

drop_runin

A logical indicating whether to drop the run-in row from the returned tibble. Run ?run_in for more details. Defaults to TRUE.

calculate_climfacs

A logical indicating whether to calculate climate factors (tfac and wfac) from the object passed to the data argument.

year

A character string indicating the name of the variable containing the year input.

tfac

A character string indicating the name of the variable containing the temperature factor. Defaults to "tfac". Used to name the temperature factor variable if calculate_climfacs is TRUE; used to find it if if calculate_climfacs is FALSE.

wfac

A character string indicating the name of the variable containing the water factor. Defaults to "wfac". Used to name the water factor variable if calculate_climfacs is TRUE; used to find it if calculate_climfacs is FALSE.

climdata

A character string indicating the name of the list column containing climate data. Defaults to "climdata"; unused if calculate_climfacs is FALSE.

temp

A character string indicating the name of the (nested) variable containing monthly temperature data. Defaults to "temp"; unused if calculate_climfacs is FALSE.

precip

A character string indicating the name of the (nested) variable containing monthly precipitation data. Defaults to "precip"; unused if calculate_climfacs is FALSE.

pet

A character string indicating the name of the (nested) variable containing monthly potential evapotranspiration data. Defaults to "pet"; unused if calc_climfacs is FALSE.

c_input

A character string naming the variable containing carbon inputs. Defaults to "c_input".

lignin_frac

A character string naming the variable containing lignin fraction. Defaults to "lignin_frac".

n_frac

A character string naming the variable containing nitrogen fraction. Defaults to "n_frac".

sand_frac

A character string naming the variable containing soil sand fraction. Defaults to "sand_frac".

till_type

A character string naming the variable containing tillage practice. Defaults to "till_type".

params

A named list containing model parameters. Defaults to the package default parameter set soilc_params.

Examples

1
run_model(soilc.ipcc::toy_input)

aj-sykes92/soilc.ipcc documentation built on March 19, 2021, 11:52 a.m.