From 1c7addccbc64809fe26b2d2ea86bd83c6e787d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20Holl=C3=B3s?= Date: Fri, 3 Jan 2020 13:04:43 +0100 Subject: [PATCH] Vartable print --- RBBGCMuso/NAMESPACE | 1 + RBBGCMuso/R/getOutPutList.R | 6 +++--- RBBGCMuso/R/setupMuso.R | 3 ++- RBBGCMuso/man/alignData.Rd | 13 +++---------- RBBGCMuso/man/changemulline.Rd | 10 ++-------- RBBGCMuso/man/checkMeteoBGC.Rd | 8 ++------ RBBGCMuso/man/compareMuso.Rd | 12 +++--------- RBBGCMuso/man/getDailyOutputList.Rd | 4 ---- RBBGCMuso/man/getMeteoData1BGC.Rd | 17 ++++------------- RBBGCMuso/man/musoDate.Rd | 10 ++-------- RBBGCMuso/man/musoMonte.Rd | 23 +++++------------------ RBBGCMuso/man/musoQuickEffect.Rd | 13 +++---------- RBBGCMuso/man/musoRand.Rd | 3 ++- RBBGCMuso/man/musoSensi.Rd | 24 ++++++------------------ RBBGCMuso/man/optiMuso.Rd | 29 ++++++++--------------------- RBBGCMuso/man/paramSweep.Rd | 11 +++-------- RBBGCMuso/man/randEpc.Rd | 9 ++------- RBBGCMuso/man/readObservedData.Rd | 16 ++++------------ RBBGCMuso/man/saveAllMusoPlots.Rd | 12 +++--------- RBBGCMuso/man/stampAndDir.Rd | 11 ++--------- 20 files changed, 60 insertions(+), 175 deletions(-) diff --git a/RBBGCMuso/NAMESPACE b/RBBGCMuso/NAMESPACE index 111ce49..0ee63c3 100644 --- a/RBBGCMuso/NAMESPACE +++ b/RBBGCMuso/NAMESPACE @@ -7,6 +7,7 @@ export(cleanupMuso) export(compareMuso) export(copyMusoExampleTo) export(corrigMuso) +export(getAnnualOutputList) export(getDailyOutputList) export(getMeteoData1BGC) export(getyearlycum) diff --git a/RBBGCMuso/R/getOutPutList.R b/RBBGCMuso/R/getOutPutList.R index 583afcf..f5adac9 100644 --- a/RBBGCMuso/R/getOutPutList.R +++ b/RBBGCMuso/R/getOutPutList.R @@ -9,7 +9,7 @@ getDailyOutputList <- function(settings=NULL){ if(is.null(settings)){ settings<- setupMuso() } - settings$dailyOutputTable + print(settings$dailyOutputTable, row.names=FALSE) } #' getAnnualOutputList @@ -19,9 +19,9 @@ getDailyOutputList <- function(settings=NULL){ #' @export -getDailyOutputList <- function(settings=NULL){ +getAnnualOutputList <- function(settings=NULL){ if(is.null(settings)){ settings<- setupMuso() } - settings$annualOutputTable + print(settings$annualOutputTable, row.names=FALSE) } diff --git a/RBBGCMuso/R/setupMuso.R b/RBBGCMuso/R/setupMuso.R index d606dfb..bfa9378 100644 --- a/RBBGCMuso/R/setupMuso.R +++ b/RBBGCMuso/R/setupMuso.R @@ -166,6 +166,7 @@ setupMuso <- function(executable=NULL, outIndex<-grep("ANNUAL_OUTPUT",iniFiles[[2]])+1 numVar<-as.numeric(unlist(strsplit(iniFiles[[2]][outIndex],"[\ \t]"))[1]) annualVarCodes<-iniFiles[[2]][(outIndex+1):(outIndex+numVar)] + annualVarCodes<-unlist(lapply(annualVarCodes, function(x) unlist(strsplit(x,"[\ \t]"))[1])) annualVarnames<-unlist(lapply(annualVarCodes, function(x) musoMapping(unlist(strsplit(x,"[\ \t]"))[1]))) outputVars<-list(dailyVarnames,annualVarnames) # browser() @@ -273,7 +274,7 @@ setupMuso <- function(executable=NULL, dailyOutputTable <- cbind.data.frame(seq_along(dailyVarCodes),dailyVarCodes,outputVars[[1]]) colnames(dailyOutputTable) <- c("index","code","name") annualOutputTable <- cbind.data.frame(seq_along(annualVarCodes),annualVarCodes,outputVars[[2]]) - colnames(dailyOutputTable) <- c("index","code","name") + colnames(annualOutputTable) <- c("index","code","name") settings = list(executable = executable, calibrationPar = calibrationPar, diff --git a/RBBGCMuso/man/alignData.Rd b/RBBGCMuso/man/alignData.Rd index 0200b96..3ba4f7f 100644 --- a/RBBGCMuso/man/alignData.Rd +++ b/RBBGCMuso/man/alignData.Rd @@ -4,16 +4,9 @@ \alias{alignData} \title{alignData} \usage{ -alignData( - mdata, - dataCol, - modellSettings = NULL, - startDate = NULL, - endDate = NULL, - formatString = "\%Y-\%m-\%d", - leapYear = TRUE, - continious = FALSE -) +alignData(mdata, dataCol, modellSettings = NULL, startDate = NULL, + endDate = NULL, formatString = "\%Y-\%m-\%d", leapYear = TRUE, + continious = FALSE) } \description{ This function align the data to the model and the model to the data diff --git a/RBBGCMuso/man/changemulline.Rd b/RBBGCMuso/man/changemulline.Rd index e7ec966..7acf438 100644 --- a/RBBGCMuso/man/changemulline.Rd +++ b/RBBGCMuso/man/changemulline.Rd @@ -4,14 +4,8 @@ \alias{changemulline} \title{This is the function which is capable to change multiple specific lines to others using their row numbers.} \usage{ -changemulline( - filePaths, - calibrationPar, - contents, - fileOut, - fileToChange, - modifyOriginal = FALSE -) +changemulline(filePaths, calibrationPar, contents, fileOut, fileToChange, + modifyOriginal = FALSE) } \description{ The function uses the previous changspecline function to operate. diff --git a/RBBGCMuso/man/checkMeteoBGC.Rd b/RBBGCMuso/man/checkMeteoBGC.Rd index 02bdcfa..9d19096 100644 --- a/RBBGCMuso/man/checkMeteoBGC.Rd +++ b/RBBGCMuso/man/checkMeteoBGC.Rd @@ -4,12 +4,8 @@ \alias{checkMeteoBGC} \title{checkMeteoBGC} \usage{ -checkMeteoBGC( - settings = NULL, - skip = 4, - numericReport = FALSE, - type = "normal" -) +checkMeteoBGC(settings = NULL, skip = 4, numericReport = FALSE, + type = "normal") } \arguments{ \item{settings}{The output of setupMuso} diff --git a/RBBGCMuso/man/compareMuso.Rd b/RBBGCMuso/man/compareMuso.Rd index b4c6380..4890945 100644 --- a/RBBGCMuso/man/compareMuso.Rd +++ b/RBBGCMuso/man/compareMuso.Rd @@ -4,15 +4,9 @@ \alias{compareMuso} \title{compareMuso} \usage{ -compareMuso( - settings = NULL, - parameters, - variable = 1, - calibrationPar = NULL, - fileToChange = "epc", - skipSpinup = TRUE, - timeFrame = "day" -) +compareMuso(settings = NULL, parameters, variable = 1, + calibrationPar = NULL, fileToChange = "epc", skipSpinup = TRUE, + timeFrame = "day") } \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.} diff --git a/RBBGCMuso/man/getDailyOutputList.Rd b/RBBGCMuso/man/getDailyOutputList.Rd index cfb0c76..f02058b 100644 --- a/RBBGCMuso/man/getDailyOutputList.Rd +++ b/RBBGCMuso/man/getDailyOutputList.Rd @@ -4,15 +4,11 @@ \alias{getDailyOutputList} \title{getDailyOutputList} \usage{ -getDailyOutputList(settings = NULL) - getDailyOutputList(settings = NULL) } \arguments{ \item{settings}{bla} } \description{ -bla bla - bla bla } diff --git a/RBBGCMuso/man/getMeteoData1BGC.Rd b/RBBGCMuso/man/getMeteoData1BGC.Rd index 823eecf..3ab9c9f 100644 --- a/RBBGCMuso/man/getMeteoData1BGC.Rd +++ b/RBBGCMuso/man/getMeteoData1BGC.Rd @@ -4,19 +4,10 @@ \alias{getMeteoData1BGC} \title{getMeteoData1BGC} \usage{ -getMeteoData1BGC( - startYear = 2017, - endYear = 2017, - lon = 18.8, - lat = 47.3, - timeOut = 7200, - monthList = sprintf("\%02d", 1:12), - dayList = sprintf("\%02d", 1:31), - hourList = sprintf("\%02d:00", 0:23), - destDir = NULL, - apiFile = NULL, - fileDir = NULL -) +getMeteoData1BGC(startYear = 2017, endYear = 2017, lon = 18.8, + lat = 47.3, timeOut = 7200, monthList = sprintf("\%02d", 1:12), + dayList = sprintf("\%02d", 1:31), hourList = sprintf("\%02d:00", + 0:23), destDir = NULL, apiFile = NULL, fileDir = NULL) } \arguments{ \item{startYear}{Start year of the downloading data. It shall be greater than 1978.} diff --git a/RBBGCMuso/man/musoDate.Rd b/RBBGCMuso/man/musoDate.Rd index d2d47f6..d8096e7 100644 --- a/RBBGCMuso/man/musoDate.Rd +++ b/RBBGCMuso/man/musoDate.Rd @@ -4,14 +4,8 @@ \alias{musoDate} \title{musoDate} \usage{ -musoDate( - startYear, - endYears = NULL, - numYears, - combined = TRUE, - leapYearHandling = FALSE, - prettyOut = FALSE -) +musoDate(startYear, endYears = NULL, numYears, combined = TRUE, + leapYearHandling = FALSE, prettyOut = FALSE) } \description{ This function generates MuSo compatibla dates for the data diff --git a/RBBGCMuso/man/musoMonte.Rd b/RBBGCMuso/man/musoMonte.Rd index 6931dc1..e7b37cf 100644 --- a/RBBGCMuso/man/musoMonte.Rd +++ b/RBBGCMuso/man/musoMonte.Rd @@ -4,24 +4,11 @@ \alias{musoMonte} \title{musoMonte} \usage{ -musoMonte( - settings = NULL, - parameters = NULL, - inputDir = "./", - outLoc = "./calib", - iterations = 10, - preTag = "mont-", - outputType = "moreCsv", - fun = mean, - varIndex = 1, - outVars = NULL, - silent = TRUE, - skipSpinup = TRUE, - debugging = FALSE, - keepEpc = FALSE, - constrains = NULL, - ... -) +musoMonte(settings = NULL, parameters = NULL, inputDir = "./", + outLoc = "./calib", iterations = 10, preTag = "mont-", + outputType = "moreCsv", fun = mean, varIndex = 1, outVars = NULL, + silent = TRUE, skipSpinup = TRUE, debugging = FALSE, + keepEpc = FALSE, constrains = NULL, ...) } \arguments{ \item{settings}{A list of environmental variables for the Monte Carlo experiment. These settings are generated by the setupMuso function. By default the settings parameter is generated automatically.} diff --git a/RBBGCMuso/man/musoQuickEffect.Rd b/RBBGCMuso/man/musoQuickEffect.Rd index a6a7bef..1676a4e 100644 --- a/RBBGCMuso/man/musoQuickEffect.Rd +++ b/RBBGCMuso/man/musoQuickEffect.Rd @@ -4,16 +4,9 @@ \alias{musoQuickEffect} \title{musoQuickEffect} \usage{ -musoQuickEffect( - settings = NULL, - calibrationPar = NULL, - startVal, - endVal, - nSteps = 1, - fileToChange = "epc", - outVar, - parName = "parVal" -) +musoQuickEffect(settings = NULL, calibrationPar = NULL, startVal, + endVal, nSteps = 1, fileToChange = "epc", outVar, + parName = "parVal") } \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.} diff --git a/RBBGCMuso/man/musoRand.Rd b/RBBGCMuso/man/musoRand.Rd index d512ce1..208748b 100644 --- a/RBBGCMuso/man/musoRand.Rd +++ b/RBBGCMuso/man/musoRand.Rd @@ -4,7 +4,8 @@ \alias{musoRand} \title{musoRand} \usage{ -musoRand(parameters, iterations = 3000, fileType = "epc", constrains = NULL) +musoRand(parameters, iterations = 3000, fileType = "epc", + constrains = NULL) } \arguments{ \item{parameters}{This is a dataframe (heterogeneous data-matrix), where the first column is the name of the parameter, the second is a numeric vector of the rownumbers of the given variable in the input EPC file, and the last two columns describe the minimum and the maximum of the parameter (i.e. the parameter ranges), defining the interval for the randomization.} diff --git a/RBBGCMuso/man/musoSensi.Rd b/RBBGCMuso/man/musoSensi.Rd index 01eba32..4086151 100644 --- a/RBBGCMuso/man/musoSensi.Rd +++ b/RBBGCMuso/man/musoSensi.Rd @@ -4,24 +4,12 @@ \alias{musoSensi} \title{musoSensi} \usage{ -musoSensi( - monteCarloFile = NULL, - parameters = NULL, - settings = NULL, - inputDir = "./", - outLoc = "./calib", - outVars = NULL, - iterations = 30, - preTag = "mont-", - outputType = "moreCsv", - fun = mean, - varIndex = 1, - outputFile = "sensitivity.csv", - plotName = "sensitivity.png", - plotTitle = "Sensitivity", - skipSpinup = TRUE, - dpi = 300 -) +musoSensi(monteCarloFile = NULL, parameters = NULL, settings = NULL, + inputDir = "./", outLoc = "./calib", outVars = NULL, + iterations = 30, preTag = "mont-", outputType = "moreCsv", + fun = mean, varIndex = 1, outputFile = "sensitivity.csv", + plotName = "sensitivity.png", plotTitle = "Sensitivity", + skipSpinup = TRUE, dpi = 300) } \arguments{ \item{parameters}{This is a dataframe (heterogen data-matrix), which first column is the name of the parameters, the second is a numeric vector of the rownumbers of the given variable in the epc-fie, the last two column consist the endpont of the parameter-ranges, where the parameters will be randomized.} diff --git a/RBBGCMuso/man/optiMuso.Rd b/RBBGCMuso/man/optiMuso.Rd index d37f76e..4e4a64d 100644 --- a/RBBGCMuso/man/optiMuso.Rd +++ b/RBBGCMuso/man/optiMuso.Rd @@ -4,27 +4,14 @@ \alias{optiMuso} \title{optiMuso} \usage{ -optiMuso( - measuredData, - parameters = NULL, - startDate = NULL, - endDate = NULL, - formatString = "\%Y-\%m-\%d", - leapYearHandling = TRUE, - dataVar, - outLoc = "./calib", - preTag = "cal-", - settings = NULL, - outVars = NULL, - iterations = 30, - skipSpinup = TRUE, - constrains = NULL, - plotName = "calib.jpg", - likelihood = function(x, y) { exp(-sqrt(mean((x - y)^2))) }, - continious, - modelVar = 3009, - postProcString = NULL -) +optiMuso(measuredData, parameters = NULL, startDate = NULL, + endDate = NULL, formatString = "\%Y-\%m-\%d", + leapYearHandling = TRUE, dataVar, outLoc = "./calib", + preTag = "cal-", settings = NULL, outVars = NULL, + iterations = 30, skipSpinup = TRUE, constrains = NULL, + plotName = "calib.jpg", likelihood = function(x, y) { + exp(-sqrt(mean((x - y)^2))) }, continious, modelVar = 3009, + postProcString = NULL) } \arguments{ \item{parameters}{b} diff --git a/RBBGCMuso/man/paramSweep.Rd b/RBBGCMuso/man/paramSweep.Rd index 8933dce..39d435a 100644 --- a/RBBGCMuso/man/paramSweep.Rd +++ b/RBBGCMuso/man/paramSweep.Rd @@ -4,14 +4,9 @@ \alias{paramSweep} \title{paramSweep} \usage{ -paramSweep( - inputDir = "./", - parameters = NULL, - outputDir = NULL, - iterations = 10, - outVar = "daily_gpp", - htmlOutName = "paramsweep.html" -) +paramSweep(inputDir = "./", parameters = NULL, outputDir = NULL, + iterations = 10, outVar = "daily_gpp", + htmlOutName = "paramsweep.html") } \arguments{ \item{inputDir}{The directory which contains the MuSo model's ini files} diff --git a/RBBGCMuso/man/randEpc.Rd b/RBBGCMuso/man/randEpc.Rd index 4a83540..6087be7 100644 --- a/RBBGCMuso/man/randEpc.Rd +++ b/RBBGCMuso/man/randEpc.Rd @@ -4,13 +4,8 @@ \alias{randEpc} \title{randEpc} \usage{ -randEpc( - parameterFile = "parameters.csv", - location = "./epcDir", - sourceEpc = "maize.epc", - iterations = 1000, - constrains = NULL -) +randEpc(parameterFile = "parameters.csv", location = "./epcDir", + sourceEpc = "maize.epc", iterations = 1000, constrains = NULL) } \arguments{ \item{parameterFile}{parameters.csv file location} diff --git a/RBBGCMuso/man/readObservedData.Rd b/RBBGCMuso/man/readObservedData.Rd index e079014..622b4a3 100644 --- a/RBBGCMuso/man/readObservedData.Rd +++ b/RBBGCMuso/man/readObservedData.Rd @@ -4,19 +4,11 @@ \alias{readObservedData} \title{readMeasuredMuso} \usage{ -readObservedData( - inFile, - naString = NULL, - sep = ",", - leapYearHandling = TRUE, - convert.var = NULL, - convert.scalar = 1, +readObservedData(inFile, naString = NULL, sep = ",", + leapYearHandling = TRUE, convert.var = NULL, convert.scalar = 1, convert.fun = (function(x) { x * convert.scalar }), - convert.file = NULL, - filterCol = NULL, - filterVal = 1, - selVar = NULL -) + convert.file = NULL, filterCol = NULL, filterVal = 1, + selVar = NULL) } \description{ MuSo data reader diff --git a/RBBGCMuso/man/saveAllMusoPlots.Rd b/RBBGCMuso/man/saveAllMusoPlots.Rd index ec4c9d8..79b184b 100644 --- a/RBBGCMuso/man/saveAllMusoPlots.Rd +++ b/RBBGCMuso/man/saveAllMusoPlots.Rd @@ -4,15 +4,9 @@ \alias{saveAllMusoPlots} \title{saveAllMusoPlots} \usage{ -saveAllMusoPlots( - settings = NULL, - plotName = ".png", - silent = TRUE, - type = "line", - outFile = "annual.csv", - colour = NULL, - skipSpinup = FALSE -) +saveAllMusoPlots(settings = NULL, plotName = ".png", silent = TRUE, + type = "line", outFile = "annual.csv", colour = NULL, + skipSpinup = FALSE) } \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.} diff --git a/RBBGCMuso/man/stampAndDir.Rd b/RBBGCMuso/man/stampAndDir.Rd index c30516e..c1d2843 100644 --- a/RBBGCMuso/man/stampAndDir.Rd +++ b/RBBGCMuso/man/stampAndDir.Rd @@ -4,15 +4,8 @@ \alias{stampAndDir} \title{stampAndCopy} \usage{ -stampAndDir( - outputLoc, - names, - stampDir, - wrongDir, - type = "output", - errorsign, - logfiles -) +stampAndDir(outputLoc, names, stampDir, wrongDir, type = "output", + errorsign, logfiles) } \arguments{ \item{outputLoc}{This is the location of the output files.}