Skip to content

Commit

Permalink
upload mdi files
Browse files Browse the repository at this point in the history
  • Loading branch information
drueke committed Oct 16, 2019
1 parent 65eb380 commit 75cd13b
Show file tree
Hide file tree
Showing 284 changed files with 23,941 additions and 2 deletions.
48 changes: 48 additions & 0 deletions HowToMakeRpackage_LPJmL-MDI.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#--------------------------------------------
# Building and installation of an R package:
# Matthias Forkel, 2017-08-02
#--------------------------------------------

# package development is based on inlinedocs (for in-line documentation)
library(inlinedocs)
library(here)

# name and directory of package
pkg.name <- "LPJmLmdi"
path <- paste(here::here(), sep="/")


# BUILDING
#---------

# Building is only required if you further develop the package, i.e. if you want to newly
# create help files and perform tests. Continue with the next section if you just downloaded
# the package and you want to install it.

# build package structure and Rd files
setwd(path)
package.skeleton.dx(pkg.name)

# check package
cmd <- sprintf(paste("%s CMD check --as-cran", pkg.name), file.path(R.home("bin"), "R"))
system(cmd, intern=TRUE)

# build package
cmd <- sprintf(paste("%s CMD build --resave-data", pkg.name), file.path(R.home("bin"), "R"))
system(cmd, intern=TRUE)


# INSTALLATION
#-------------

# installation
cmd <- paste("R CMD INSTALL --html", pkg.name, "--resave-data")
tryCatch(system(cmd), finally=setwd(path))

# load package
library(pkg.name, character.only=TRUE)

# check package help files:
?OptimizeLPJgenoud


13 changes: 13 additions & 0 deletions LPJmLmdi.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX
86 changes: 86 additions & 0 deletions LPJmLmdi/.Rhistory
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
install.packages("bfast")
install.packages("phenopix")
here()
setwd("~/shares/home/code/R/_gitlab/")
pkgs <- c("RobinsonMaps")
i <- 1
setwd(pkgs[i])
cmd <- paste("R CMD INSTALL --html ", pkgs[i], " --resave-data")
tryCatch(system(cmd), finally=setwd(path))
getwd()
pkgs <- c("RobinsonMaps", "ModelDataComp")
setwd("..")
setwd(pkgs[i])
cmd <- paste("R CMD INSTALL --html ", pkgs[i], " --resave-data")
tryCatch(system(cmd))
setwd("..")
getwd()
pkgs <- c("RobinsonMaps", "ModelDataComp")
i <- 2
setwd(pkgs[i])
cmd <- paste("R CMD INSTALL --html ", pkgs[i], " --resave-data")
tryCatch(system(cmd))
setwd("..")
install.packages("lhs")
setwd("~/shares/home/code/R/_gitlab/")
pkgs <- c("RobinsonMaps", "ModelDataComp")
i <- 2
setwd(pkgs[i])
cmd <- paste("R CMD INSTALL --html ", pkgs[i], " --resave-data")
tryCatch(system(cmd))
setwd("..")
install.packages("randomForest")
i <- 2
setwd(pkgs[i])
cmd <- paste("R CMD INSTALL --html ", pkgs[i], " --resave-data")
tryCatch(system(cmd))
setwd("..")
pkgs <- c("RobinsonMaps", "ModelDataComp", "Raster4ML")
i <- 3
setwd(pkgs[i])
cmd <- paste("R CMD INSTALL --html ", pkgs[i], " --resave-data")
tryCatch(system(cmd))
setwd("..")
install.packages("ICEbox")
install.packages("ff")
setwd("~/shares/home/code/R/greenbrown")
cmd <- paste("R CMD INSTALL --html greenbrown --resave-data")
tryCatch(system(cmd))
setwd("~/shares/home/code/R/_gitlab/")
pkgs <- c("RobinsonMaps", "ModelDataComp", "Raster4ML")
i <- 3
setwd(pkgs[i])
cmd <- paste("R CMD INSTALL --html ", pkgs[i], " --resave-data")
tryCatch(system(cmd))
setwd("..")
setwd("~/shares/home/code/R/_gitlab-pik/LPJmLmdi/")
tryCatch(system("R CMD INSTALL --html LPJmLmdi --resave-data"))
grep("o", letters)
# package development is based on inlinedocs (for in-line documentation)
library(inlinedocs)
library(here)
# name and directory of package
pkg.name <- "LPJmLmdi"
path <- paste(here::here(), sep="/")
# Building is only required if you further develop the package, i.e. if you want to newly
# create help files and perform tests. Continue with the next section if you just downloaded
# the package and you want to install it.
# build package structure and Rd files
setwd(path)
package.skeleton.dx(pkg.name)
# check package
cmd <- sprintf(paste("%s CMD check --as-cran", pkg.name), file.path(R.home("bin"), "R"))
system(cmd, intern=TRUE)
# check package
cmd <- sprintf(paste("%s CMD check --as-cran", pkg.name), file.path(R.home("bin"), "R"))
system(cmd, intern=TRUE)
# build package
cmd <- sprintf(paste("%s CMD build --resave-data", pkg.name), file.path(R.home("bin"), "R"))
system(cmd, intern=TRUE)
# installation
setwd(here::here())
cmd <- paste("R CMD INSTALL --html", pkg.name, "--resave-data")
tryCatch(system(cmd), finally=setwd(path))
# load package
library(pkg.name, character.only=TRUE)
?PlotParUnc
12 changes: 12 additions & 0 deletions LPJmLmdi/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Package: LPJmLmdi
Title: Model-Data Integration for the LPJmL Dynamic Global Vegetation Model
Version: 1.3
Date: 2019-01-22
Author: Matthias Forkel <[email protected]> [aut, cre], Markus Drüke <[email protected]> [aut]
Maintainer: Matthias Forkel <[email protected]>, Markus Drüke <[email protected]>
Description: Model-data integration framework for the LPJmL dynamic global vegetation model. Specifically, the package provides functions 1) to optimize LPJmL model parameters using the GENOUD genetic optimization algorithm, 2) to read and write LPJmL input data, and 3) to read LPJmL output files.
Depends: R (>= 2.15.3), raster, plyr, rgenoud, ncdf4, ModelDataComp
Imports: dplyr, plotrix, fields, tidyr
License: GPL-2
URL:
LazyLoad: yes
5 changes: 5 additions & 0 deletions LPJmLmdi/NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
importFrom("plotrix", "color.legend")
importFrom("tidyr", "separate", "unite", "gather")
importFrom("RColorBrewer", "brewer.pal")
exportPattern("^[[:alpha:]]+")

Loading

0 comments on commit 75cd13b

Please sign in to comment.