Description Usage Arguments Examples
Write out default SWAT 2012 meteorology input file
1 2 | write_input_swat2012_other(file, data, station_names, type,
col_time_name = "time_posix")
|
file |
string: directory + file name of output file |
data |
data.frame: contains a column with time stamp and >=1 columns with data; time column needs to be of type POSIXct |
station_names |
character-array: contains names of the stations to write out; have to be equal to column names of data |
type |
character: file type ('wnd', 'slr', 'hmd'); only used in the header row |
col_time_name |
character, optional: name of the time stamp column, default = 'time_posix' |
1 2 3 4 5 6 7 8 9 10 | # see example in README
explanation of the following command:
- make time column:
format(data[[time_name]],"%Y%m%d")
- format the individual values of the data column:
formatC(as.matrix(data[station_names]), format='f', width=8, digits=3, flag='0')
We need 'as.matrix' because my_data is a data frame. formatC cannot be applied to a 2d data frame.
- append all formatted data values in one row:
apply(formatC(...), 1, paste0, collapse = '')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.