View source: R/setPrjOutputVariables.R
setPrjOutputVariables | R Documentation |
.prj
fileSets the output variables in a CRHM model .prj
file
setPrjOutputVariables(
inputPrjFile = "",
variables = "",
outputPrjFile = "",
logfile = ""
)
inputPrjFile |
Required. Name of the |
variables |
Required. Variables to be written to output file. These may be either a character vector combining the variable module, variable name and HRUs or a dataframe with the same information in 3 separate columns. Either format can be returned by |
outputPrjFile |
Optional. If omitted, the input |
logfile |
Optional. Name of the file to be used for logging the action. Normally not used. |
If successful, returns TRUE
. If unsuccessful, returns FALSE
.
Kevin Shook
readPrjOutputVariables
setPrjDates
## Not run:
# read in existing variables as a vector
variables <- readPrjOutputVariables('Bad_Lake_1974-1975.prj', asDataframe=FALSE)
# delete the first set of variables and write to a new file
variables <- variables[-1]
setPrjOutputVariables('Bad_Lake_1974-1975.prj', variables, 'Bad_Lake_1974-1975_revised.prj')
# read in existing variables as a dataframe and write to new file
variables <- readPrjOutputVariables('Bad_Lake_1974-1975.prj', asDataframe=TRUE)
newVariables <- c('evap', 'evapGrangerD', '1 2 3 4 5')
variables <- rbind(variables, newVariables)
setPrjOutputVariables('Bad_Lake_1974-1975.prj', variables, 'Bad_Lake_1974-1975_revised2.prj')
# deletes all output variables and overwrites the file
result <- setPrjOutputVariables('Bad_Lake_1974-1975.prj', 'null')
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.