put back the missing musoExamples
This commit is contained in:
parent
483935670f
commit
c0ca49e73b
@ -1,6 +1,6 @@
|
||||
Package: RBBGCMuso
|
||||
Title: An R package for BiomeBGC-MuSo ecosystem modelling
|
||||
Version: 0.5.0.0-0
|
||||
Version: 0.6.0.0-1
|
||||
Authors@R: person("Roland", "Hollo's", , "hollorol@gmail.com", role = c("aut", "cre"))
|
||||
Description: What the package does (one paragraph).
|
||||
Depends: R (>= 2.10)
|
||||
|
||||
@ -1 +0,0 @@
|
||||
hollorol@meteor22.13528:1542837570
|
||||
@ -1 +0,0 @@
|
||||
hollorol@meteor22.13528:1542837570
|
||||
56
RBBGCMuso/R/musoExample.R
Executable file
56
RBBGCMuso/R/musoExample.R
Executable file
@ -0,0 +1,56 @@
|
||||
#'copyMusoExampleTo
|
||||
#'
|
||||
#'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.
|
||||
#'@param destination The destination where the example files will be copied.
|
||||
#'@export
|
||||
|
||||
copyMusoExamleTo <- function(example = NULL, destination = NULL){
|
||||
WindowsP <- Sys.info()[1] == "Windows"
|
||||
|
||||
chooseExample <- function(){
|
||||
choiceWin <- tcltk::tktoplevel()
|
||||
tcltk::tclRequire("BWidget")
|
||||
tcltk::tktitle(choiceWin) <- "Choose an example!"
|
||||
tcltk::tcl("wm","geometry",choiceWin,"200x50")
|
||||
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,
|
||||
textvariable = tcltk::tclVar(choiceValues[1]))
|
||||
tcltk::tkpack(choices)
|
||||
choiceValue <- NA
|
||||
closeSelection <- tcltk::tkwidget(choiceWin,"button",text ="Select", command =function (){
|
||||
choiceValue <<- tcltk::tclvalue(tcltk::tcl(choices,"get"))
|
||||
tcltk::tkdestroy(choiceWin)
|
||||
})
|
||||
|
||||
tcltk::tkpack(closeSelection)
|
||||
while(as.numeric(tcltk::tclvalue(tcltk::tcl("winfo","exists",choiceWin)))){
|
||||
|
||||
}
|
||||
return(choiceValue)
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(is.null(example)){
|
||||
cExample<-paste0(system.file("examples","",package = "RBBGCMuso"),"/",chooseExample())
|
||||
}
|
||||
|
||||
if(is.null(destination)){
|
||||
destination<-tcltk::tk_choose.dir(getwd(), "Choose folder to copy the examples!")
|
||||
}
|
||||
|
||||
currDir <- getwd()
|
||||
setwd(cExample)
|
||||
if(!WindowsP){
|
||||
file.copy("./bin/muso", destination)
|
||||
} else {
|
||||
file.copy("./bin/muso.exe", destination)
|
||||
file.copy("./bin/cygwin1.dll", destination)
|
||||
}
|
||||
file.copy(grep("bin", list.files(), value = TRUE, invert = TRUE),destination)
|
||||
setwd(currDir)
|
||||
}
|
||||
BIN
RBBGCMuso_0.6.0.0-1.tar.gz
Executable file
BIN
RBBGCMuso_0.6.0.0-1.tar.gz
Executable file
Binary file not shown.
BIN
RBBGCMuso_0.6.0.0-1.zip
Executable file
BIN
RBBGCMuso_0.6.0.0-1.zip
Executable file
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
basePackages <- c("dplyr","digest","ggplot2","shiny","latex2expr",
|
||||
"magrittr","tibble","tidyr","installr")
|
||||
"magrittr","tibble","tidyr")
|
||||
install.packages(basePackages)
|
||||
install.packages("https://github.com/hollorol/RBBGCMuso/raw/master/RBBGCMuso_0.5.0.0-0.zip", repos = NULL, type = "win.binary")
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user