write.dmna {readmet} | R Documentation |
function to write data to a file in DMNA-format
Description
writes gridded on-e, two or three-dimensional data or timeseries to a DMNA format that is used for example by the German national dispersion model AUSTAL
Usage
write.dmna(filename, values, axes=NULL, name=NULL, types=NULL, vldf="V", debug=FALSE)
Arguments
filename |
name (and path if necessary) of the file to write |
values |
matrix or list(matrix) or data.frame. Matrix or list(matrix) implies writing gridded data. list(matrix) must be named using the variable names. data.frame implies writing a timeseries and must contain a column named "te" containing time as POXIXct. |
axes |
data.frame. Required for gridded data. Must contain columns "x" and column "y" if values are two-dimensional and additionally "sk" (or "z") if data are three-dimensional. The spacing of all values in "x" and "y" must be identical. |
name |
character string. Variable name. Required if values is of class matrix. Is ignored else. |
types |
named list. Variable type for each variable. If 'values' is a list, names in 'types' must match names in in 'values'. If 'values' is a matrix, a name in 'types' must match 'name'. Types are:
|
vldf |
character string. specifies, where values are located in the model grid. "V" denotes volume average, "P" volumne center point values, or "" volume edge values. |
debug |
boolean. ignored. Is kept for compatibility |
Value
returns nothing
Note
Introduced in version 1.6.0.
Author(s)
Clemens Druee
References
AUSTAL 3.1 model reference (by Ingenieurbuero Janicke)
Examples
#create data and write file
len <- 25
val <- list(random = matrix(runif(len * len),nrow = len))
ax <- list(x = 1:len,
y = 1:len)
write.dmna("myfile.dmna", val, ax)
# show first lines
writeLines(readLines('myfile.dmna', n=12))
# delete file
unlink("myfile.dmna")