R/rvn_df_to_Raven_table.R
rvn_df_to_Raven_table.Rd
Sets up tables for writing to Raven input files
rvn_df_to_Raven_table(attributes, units, df, id_col = TRUE, parameters = FALSE)
array of strings containing attribute/parameter names
array of strings with the corresponding units
data frame of values corresponding to attributes/parameters
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)
bool, when adding attribues/parameter tag, should ':Parameters' be used instead of ':Attributes'?
data.frame object
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