From e343c4086022786ad53549c8c8034727b0d4866e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20Holl=C3=B3s?= Date: Tue, 20 Nov 2018 07:06:58 +0100 Subject: [PATCH] Documentation, and fix the old numValues bug. --- RBBGCMuso/R/musoExamples.R | 15 ++------------- RBBGCMuso/R/setupMuso.R | 2 +- RBBGCMuso/man/copyMusoExamleTo.Rd | 5 ++--- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/RBBGCMuso/R/musoExamples.R b/RBBGCMuso/R/musoExamples.R index 4c03f0c..043dda5 100644 --- a/RBBGCMuso/R/musoExamples.R +++ b/RBBGCMuso/R/musoExamples.R @@ -3,10 +3,7 @@ #'With this function you can copy RBBGCMuso example library whereever you want #' #'@param example The name of the example file, if it is NULL tcl/tk menu will pop up to select. -#'@return List of two matrices: A and B matrix for musoRandomizer -#'@import stats -#'@import magrittr -#'@import dplyr +#'@param destination The destination where the example files will be copied. #'@export copyMusoExamleTo <- function(example = NULL, destination = NULL){ @@ -17,7 +14,7 @@ copyMusoExamleTo <- function(example = NULL, destination = NULL){ tcltk::tclRequire("BWidget") tcltk::tktitle(choiceWin) <- "Choose an example!" tcltk::tcl("wm","geometry",choiceWin,"200x50") - tcl("wm", "attributes", choiceWin, topmost=TRUE) + tcltk::tcl("wm", "attributes", choiceWin, topmost=TRUE) choiceValues <- basename(list.dirs(system.file("examples","",package = "RBBGCMuso"),recursive = FALSE)) choices <- tcltk::tkwidget(choiceWin,"ComboBox", editable = FALSE, values = choiceValues, @@ -57,11 +54,3 @@ copyMusoExamleTo <- function(example = NULL, destination = NULL){ file.copy(grep("bin", list.files(), value = TRUE, invert = TRUE),destination) setwd(currDir) } -## choiceWin <- tcltk::tktoplevel() -## tclRequire("BWidget") -## -## choiceValues <- basename(list.dirs("~/Documents/projects",recursive = FALSE)) -## choices <- tkwidget(choiceWin,"ComboBox", editable = FALSE, values = choiceValues, textvariable = tclVar(choiceValues[1])) -## tkpack(choices) -## filename<- tclvalue(tcl(choices,"get")) -## filename diff --git a/RBBGCMuso/R/setupMuso.R b/RBBGCMuso/R/setupMuso.R index 22adf3c..1336348 100644 --- a/RBBGCMuso/R/setupMuso.R +++ b/RBBGCMuso/R/setupMuso.R @@ -218,7 +218,7 @@ setupMuso <- function(executable=NULL, numData<-rep(NA,3) numYears <- as.numeric(unlist(strsplit(grep("simulation years",iniFiles[[2]],value=TRUE),"[\ \t]"))[1]) ## numYears<-unlist(read.table(iniInput[2],skip = 14,nrows = 1)[1]) - numValues <- as.numeric(unlist(strsplit(grep("number of daily output variables",iniFiles[[2]],value=TRUE),"[\ \t]"))[1]) + numValues <- as.numeric(unlist(strsplit(iniFiles[[2]][grep("DAILY_OUTPUT",iniFiles[[2]])+1],"[\ \t]"))[1]) ## numValues will be replaced to numVar ## numValues<-unlist(read.table(iniInput[2],skip=102,nrows = 1)[1]) startYear <- as.numeric(unlist(strsplit(grep("first simulation year",iniFiles[[2]],value=TRUE),"[\ \t]"))[1]) diff --git a/RBBGCMuso/man/copyMusoExamleTo.Rd b/RBBGCMuso/man/copyMusoExamleTo.Rd index 9c3d080..f69adc4 100644 --- a/RBBGCMuso/man/copyMusoExamleTo.Rd +++ b/RBBGCMuso/man/copyMusoExamleTo.Rd @@ -8,9 +8,8 @@ copyMusoExamleTo(example = NULL, destination = NULL) } \arguments{ \item{example}{The name of the example file, if it is NULL tcl/tk menu will pop up to select.} -} -\value{ -List of two matrices: A and B matrix for musoRandomizer + +\item{destination}{The destination where the example files will be copied.} } \description{ With this function you can copy RBBGCMuso example library whereever you want