Converts layer-wise values from cube2table() into SWAT-style input:
a time series for each pixel in the study area.
Usage
layervalues2pixel(
layer_values,
main_tbl,
col_name = "20220101",
inline_output = TRUE,
path_output = NULL,
append = FALSE
)Arguments
- layer_values
List. Values extracted per raster layer (from
cube2table()).- main_tbl
A table with pixel metadata (e.g., from
main_input_var()), used to name each output table.- col_name
Column name for each SWAT input table. Typically the first date in the time series (e.g., "20220101").
- inline_output
Logical. If TRUE, returns a list of data.tables.
- path_output
Directory to write one file per pixel when
inline_output = FALSE.- append
Logical. If TRUE, append to existing files; otherwise overwrite.