Skip to content

Commit 75cd13b

Browse files
committed
upload mdi files
1 parent 65eb380 commit 75cd13b

284 files changed

Lines changed: 23941 additions & 2 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

HowToMakeRpackage_LPJmL-MDI.R

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#--------------------------------------------
2+
# Building and installation of an R package:
3+
# Matthias Forkel, 2017-08-02
4+
#--------------------------------------------
5+
6+
# package development is based on inlinedocs (for in-line documentation)
7+
library(inlinedocs)
8+
library(here)
9+
10+
# name and directory of package
11+
pkg.name <- "LPJmLmdi"
12+
path <- paste(here::here(), sep="/")
13+
14+
15+
# BUILDING
16+
#---------
17+
18+
# Building is only required if you further develop the package, i.e. if you want to newly
19+
# create help files and perform tests. Continue with the next section if you just downloaded
20+
# the package and you want to install it.
21+
22+
# build package structure and Rd files
23+
setwd(path)
24+
package.skeleton.dx(pkg.name)
25+
26+
# check package
27+
cmd <- sprintf(paste("%s CMD check --as-cran", pkg.name), file.path(R.home("bin"), "R"))
28+
system(cmd, intern=TRUE)
29+
30+
# build package
31+
cmd <- sprintf(paste("%s CMD build --resave-data", pkg.name), file.path(R.home("bin"), "R"))
32+
system(cmd, intern=TRUE)
33+
34+
35+
# INSTALLATION
36+
#-------------
37+
38+
# installation
39+
cmd <- paste("R CMD INSTALL --html", pkg.name, "--resave-data")
40+
tryCatch(system(cmd), finally=setwd(path))
41+
42+
# load package
43+
library(pkg.name, character.only=TRUE)
44+
45+
# check package help files:
46+
?OptimizeLPJgenoud
47+
48+

LPJmLmdi.Rproj

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Version: 1.0
2+
3+
RestoreWorkspace: Default
4+
SaveWorkspace: Default
5+
AlwaysSaveHistory: Default
6+
7+
EnableCodeIndexing: Yes
8+
UseSpacesForTab: Yes
9+
NumSpacesForTab: 2
10+
Encoding: UTF-8
11+
12+
RnwWeave: Sweave
13+
LaTeX: pdfLaTeX

LPJmLmdi/.Rhistory

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
install.packages("bfast")
2+
install.packages("phenopix")
3+
here()
4+
setwd("~/shares/home/code/R/_gitlab/")
5+
pkgs <- c("RobinsonMaps")
6+
i <- 1
7+
setwd(pkgs[i])
8+
cmd <- paste("R CMD INSTALL --html ", pkgs[i], " --resave-data")
9+
tryCatch(system(cmd), finally=setwd(path))
10+
getwd()
11+
pkgs <- c("RobinsonMaps", "ModelDataComp")
12+
setwd("..")
13+
setwd(pkgs[i])
14+
cmd <- paste("R CMD INSTALL --html ", pkgs[i], " --resave-data")
15+
tryCatch(system(cmd))
16+
setwd("..")
17+
getwd()
18+
pkgs <- c("RobinsonMaps", "ModelDataComp")
19+
i <- 2
20+
setwd(pkgs[i])
21+
cmd <- paste("R CMD INSTALL --html ", pkgs[i], " --resave-data")
22+
tryCatch(system(cmd))
23+
setwd("..")
24+
install.packages("lhs")
25+
setwd("~/shares/home/code/R/_gitlab/")
26+
pkgs <- c("RobinsonMaps", "ModelDataComp")
27+
i <- 2
28+
setwd(pkgs[i])
29+
cmd <- paste("R CMD INSTALL --html ", pkgs[i], " --resave-data")
30+
tryCatch(system(cmd))
31+
setwd("..")
32+
install.packages("randomForest")
33+
i <- 2
34+
setwd(pkgs[i])
35+
cmd <- paste("R CMD INSTALL --html ", pkgs[i], " --resave-data")
36+
tryCatch(system(cmd))
37+
setwd("..")
38+
pkgs <- c("RobinsonMaps", "ModelDataComp", "Raster4ML")
39+
i <- 3
40+
setwd(pkgs[i])
41+
cmd <- paste("R CMD INSTALL --html ", pkgs[i], " --resave-data")
42+
tryCatch(system(cmd))
43+
setwd("..")
44+
install.packages("ICEbox")
45+
install.packages("ff")
46+
setwd("~/shares/home/code/R/greenbrown")
47+
cmd <- paste("R CMD INSTALL --html greenbrown --resave-data")
48+
tryCatch(system(cmd))
49+
setwd("~/shares/home/code/R/_gitlab/")
50+
pkgs <- c("RobinsonMaps", "ModelDataComp", "Raster4ML")
51+
i <- 3
52+
setwd(pkgs[i])
53+
cmd <- paste("R CMD INSTALL --html ", pkgs[i], " --resave-data")
54+
tryCatch(system(cmd))
55+
setwd("..")
56+
setwd("~/shares/home/code/R/_gitlab-pik/LPJmLmdi/")
57+
tryCatch(system("R CMD INSTALL --html LPJmLmdi --resave-data"))
58+
grep("o", letters)
59+
# package development is based on inlinedocs (for in-line documentation)
60+
library(inlinedocs)
61+
library(here)
62+
# name and directory of package
63+
pkg.name <- "LPJmLmdi"
64+
path <- paste(here::here(), sep="/")
65+
# Building is only required if you further develop the package, i.e. if you want to newly
66+
# create help files and perform tests. Continue with the next section if you just downloaded
67+
# the package and you want to install it.
68+
# build package structure and Rd files
69+
setwd(path)
70+
package.skeleton.dx(pkg.name)
71+
# check package
72+
cmd <- sprintf(paste("%s CMD check --as-cran", pkg.name), file.path(R.home("bin"), "R"))
73+
system(cmd, intern=TRUE)
74+
# check package
75+
cmd <- sprintf(paste("%s CMD check --as-cran", pkg.name), file.path(R.home("bin"), "R"))
76+
system(cmd, intern=TRUE)
77+
# build package
78+
cmd <- sprintf(paste("%s CMD build --resave-data", pkg.name), file.path(R.home("bin"), "R"))
79+
system(cmd, intern=TRUE)
80+
# installation
81+
setwd(here::here())
82+
cmd <- paste("R CMD INSTALL --html", pkg.name, "--resave-data")
83+
tryCatch(system(cmd), finally=setwd(path))
84+
# load package
85+
library(pkg.name, character.only=TRUE)
86+
?PlotParUnc

LPJmLmdi/DESCRIPTION

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Package: LPJmLmdi
2+
Title: Model-Data Integration for the LPJmL Dynamic Global Vegetation Model
3+
Version: 1.3
4+
Date: 2019-01-22
5+
Author: Matthias Forkel <matthias.forkel@geo.tuwien.ac.at> [aut, cre], Markus Drüke <drueke@pik-potsdam.de> [aut]
6+
Maintainer: Matthias Forkel <matthias.forkel@geo.tuwien.ac.at>, Markus Drüke <drueke@pik-potsdam.de>
7+
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.
8+
Depends: R (>= 2.15.3), raster, plyr, rgenoud, ncdf4, ModelDataComp
9+
Imports: dplyr, plotrix, fields, tidyr
10+
License: GPL-2
11+
URL:
12+
LazyLoad: yes

LPJmLmdi/NAMESPACE

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
importFrom("plotrix", "color.legend")
2+
importFrom("tidyr", "separate", "unite", "gather")
3+
importFrom("RColorBrewer", "brewer.pal")
4+
exportPattern("^[[:alpha:]]+")
5+

0 commit comments

Comments
 (0)