extract_from_swatday.asc: Extract variables from swatday.asc data.tables and organize...

Description Usage Arguments Value Examples

View source: R/extract_from_swatday.R

Description

Extract variables from swatday.asc data.tables and organize layer-wise values in columns

Usage

1
extract_from_swatday.asc(dat, layers = NULL, vars = NULL)

Arguments

dat

swatday.asc data.table as returned from readOutput.B90:

layers

integer vector addressing the layer numbers (nl) to be extracted from dat. If not supplied, values from all layers will be returned

vars

character vector containing variable names (out of "swati","theta", "wetnes","psimi","psiti" to be extracted from dat. If not supplied all 5 variables will be returned.

Value

a data.table with the layers' daily values of the variables organized in columns (wide format) with the names being made up of the variable name and layer number.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Read files from LWF-Brook90 output directory

output <- readOutput.B90("tests/out/")

# Reorganize all variables for all layers

swati_wide <- extract_from_swatday.asc(output$swatday.asc)

# select single variables and layers:
swati_wide <- extract_from_swatday.asc(output$swatday.asc,
                                       layers =1:10,
                                       vars = c("swat", "psim", "theta"))

pschmidtwalter/brook90r documentation built on April 6, 2020, 6:35 p.m.