Sets up tables for writing to Raven input files

rvn_df_to_Raven_table(attributes, units, df, id_col = TRUE, parameters = FALSE)

Arguments

attributes

array of strings containing attribute/parameter names

units

array of strings with the corresponding units

df

data frame of values corresponding to attributes/parameters

id_col

True/False of whether an numeric id column is the first column in the table and, in common Raven fashion, does not have a corresponding attribute (default: True)

parameters

bool, when adding attribues/parameter tag, should ':Parameters' be used instead of ':Attributes'?

Value

outdf

data.frame object

Author

Leland Scantlebury, leland@scantle.com

Examples

soil_classes <- data.frame('Attributes' = c('DEFAULT','ALTERNATIVE'),
                           'SAND'      = c(0.4316, 0.3000),
                           'CLAY'      = c(0.1684, 0.4000),
                           'SILT'      = c(0.4000, 0.3000),
                           'ORGANIC'   = c(0.0000, 0.0000))
attributes <- c('%SAND','%CLAY','%SILT','%ORGANIC')
units <-  rep('none',4)
soil_classes <- rvn_df_to_Raven_table(attributes, units, soil_classes)
print(soil_classes)
#>            col1   col2   col3  col4     col5
#> 1   :Attributes  %SAND  %CLAY %SILT %ORGANIC
#> 2   :Units        none   none  none     none
#> 3       DEFAULT 0.4316 0.1684   0.4        0
#> 4   ALTERNATIVE    0.3    0.4   0.3        0