setPrjMatrix | R Documentation |
.prj
fileReplaces the existing values of a single parameter, for all HRUs, in a .prj
file.
setPrjMatrix(
inputPrjFile = "",
paramName = NULL,
paramMatrix = NULL,
outputPrjFile = "",
decimals = 0,
quiet = TRUE,
logfile = ""
)
inputPrjFile |
Required. Name of the |
paramName |
Required. Name of parameter to set. |
paramMatrix |
Required. Square matrix containing new parameter values. There must be at as many rows and
columns in this vector as HRUs in the orginal |
outputPrjFile |
Optional. If omitted, the input |
decimals |
Optional. If 0, number of decimal places in output is not set. If >0, number of decimal places in output is fixed. |
quiet |
Optional. Suppresses display of messages, except for errors. If you are calling this function
in an R script, you will usually leave |
logfile |
Optional. Name of the file to be used for logging the action. Normally not used. |
If successful, returns TRUE
. If unsuccessful, returns FALSE
.
Currently, this function has only been tested on simple .prj
files, i.e. without REW Grp parameters. It might work for complex files if the REW Grp specification is included in the parameter name.
Kevin Shook
readPrjMatrix
## Not run:
prj_file <- "Cluster1_PTH_100km2_WFDEI-GEM_new_watershed10_50%_IN.prj"
distrib_route_vals <- readPrjMatrix(prj_file, "distrib_Route")
distrib_route_vals[, 10] <- 0
result <- setPrjMatrix(prj_file, "distrib_Route",distrib_route_vals))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.