Adding csv functionality to saveAllmusoPlots

This commit is contained in:
hollorol 2019-02-10 09:39:38 +01:00
parent 3195d76bcb
commit dcddaee7f5
2 changed files with 4 additions and 3 deletions

View File

@ -327,7 +327,7 @@ compareMuso <- function(settings=NULL,parameters, variable=1, calibrationPar=NUL
saveAllMusoPlots <- function(settings=NULL, plotName = ".png", saveAllMusoPlots <- function(settings=NULL, plotName = ".png",
silent = TRUE, type = "line", silent = TRUE, type = "line", outFile = "annual.csv",
colour = NULL, skipSpinup = FALSE){ colour = NULL, skipSpinup = FALSE){
if(is.null(settings)){ if(is.null(settings)){
@ -348,7 +348,7 @@ saveAllMusoPlots <- function(settings=NULL, plotName = ".png",
} }
musoYData <- getyearlyout(settings) musoYData <- getyearlyout(settings)
write.csv(musoYData,paste0(settings$outputNames[[2]],outFile))
for(i in seq_along(annualVarCodes)){ for(i in seq_along(annualVarCodes)){
outPlot <- ggplot(data = musoYData, mapping = aes_string(x = "year", y = paste0("var_",annualVarCodes[i])))+ outPlot <- ggplot(data = musoYData, mapping = aes_string(x = "year", y = paste0("var_",annualVarCodes[i])))+
geom_bar(stat = "identity")+ labs(y = musoMapping(annualVarCodes[i])) + theme_classic() + geom_bar(stat = "identity")+ labs(y = musoMapping(annualVarCodes[i])) + theme_classic() +

View File

@ -5,7 +5,8 @@
\title{saveAllMusoPlots} \title{saveAllMusoPlots}
\usage{ \usage{
saveAllMusoPlots(settings = NULL, plotName = ".png", silent = TRUE, saveAllMusoPlots(settings = NULL, plotName = ".png", silent = TRUE,
type = "line", colour = NULL, skipSpinup = FALSE) type = "line", outFile = "annual.csv", colour = NULL,
skipSpinup = FALSE)
} }
\arguments{ \arguments{
\item{settings}{RBBGCMuso uses variables that define the entire simulation environment. Those environment variables include the name of the INI files, the name of the meteorology files, the path to the model executable and its file name, the entire output list, the entire output variable matrix, the dependency rules for the EPC parameters etc. Using the runMuso function RBBGCMuso can automatically create those environment variables by inspecting the files in the working directory (this happens through the setupMuso function). It means that by default model setup is performed automatically in the background and the user has nothing to do. With this settings parameter we can force runMuso to skip automatic environment setup as we provide the environment settings to runMuso. In a typical situation the user can skip this option.} \item{settings}{RBBGCMuso uses variables that define the entire simulation environment. Those environment variables include the name of the INI files, the name of the meteorology files, the path to the model executable and its file name, the entire output list, the entire output variable matrix, the dependency rules for the EPC parameters etc. Using the runMuso function RBBGCMuso can automatically create those environment variables by inspecting the files in the working directory (this happens through the setupMuso function). It means that by default model setup is performed automatically in the background and the user has nothing to do. With this settings parameter we can force runMuso to skip automatic environment setup as we provide the environment settings to runMuso. In a typical situation the user can skip this option.}