makeExperimentTable: Make Experiment Master Table

Description Usage Arguments Details Examples

View source: R/write_xdb_helper_funs.R

Description

This function extracts Experiment level parameters from experiment combination strings that have been parsed into soil and weather parameters. Inputs are vectors of the same length, or single values to be repeated for all experiments. Outputs a data frame containing arguments needed for 'write_xdb_experiment'. See http://salusmodel.glg.msu.edu/salus.ddb.xml for more information about SALUS parameter options.

Usage

1
2
makeExperimentTable(runTitle, ExpID, mukey, wthID, ExpCode, startyear,
  Nyears, startDOY, cropfp, state = "KS")

Arguments

runTitle

Name of overall run scenario

ExpID

Sequential ID for experiment

mukey

soil mukey from SSURGO

wthID

weather station ID

ExpCode

text string denoting sequence of annual climate-soil-crop-irrigation rotations, separated by '_'

startyear

year to start experiment

Nyears

Number of years in experiment

startDOY

Starting day of year, fills in SDOY parameter

cropfp

Filepath to crop .cdb.xml database file.

state

state, 2-letter abbreviation. defaults to 'KS'

Details

All other SALUS Experiment parameters are set currently as default.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Prepare the input using output from 02.21, GetExperiments
# Essentially df of ExpID and continuous management string
lemaExps <- lemaExps %>%
  mutate(nldas = str_sub(ExpCode, start = 10, end = 13),
        state = str_sub(ExpCode, start = 1, end = 3),
        mukey = str_sub(ExpCode, start = 3, end = 9),
        static = str_sub(ExpCode, start = 1, end = 13))

# translate mukey, expid, and nldas info into data.frame of Experiment parameters
exp_master <- makeExperimentTable('run title', lemaExps$ExpID, lemaExps$mukey,
                                  lemaExps$nldas, lemaExps$ExpCode, 2005, 11, 265,
                                  'cropsn29Dec2016_SGttMatrFixed.cdb.xml')

jdeines/salustools documentation built on May 29, 2019, 1:03 a.m.