Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bdc7ae3
commit 3572d08
Showing
28 changed files
with
1,047 additions
and
952 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
Package: simecol | ||
Version: 0.8-4 | ||
Date: 2013-09-15 | ||
Title: Simulation of ecological (and other) dynamic systems | ||
Version: 0.8-6 | ||
Date: 2015-03-19 | ||
Title: Simulation of Ecological (and Other) Dynamic Systems | ||
Author: Thomas Petzoldt | ||
Depends: R (>= 2.14), deSolve, methods | ||
Suggests: tcltk, FME, lattice | ||
LazyLoad: yes | ||
Maintainer: Thomas Petzoldt <thomas.petzoldt@tu-dresden.de> | ||
Description: simecol is an object oriented framework to simulate | ||
Description: An object oriented framework to simulate | ||
ecological (and other) dynamic systems. It can be used for | ||
differential equations, individual-based (or agent-based) and other | ||
models as well. The package helps to organize scenarios (avoids copy | ||
and paste) and improves readability and usability of code. | ||
models as well. The package helps to organize scenarios (to avoid copy | ||
and paste) and aims to improve readability and usability of code. | ||
License: GPL (>= 2) | ||
URL: http://www.simecol.de/ | ||
Repository: CRAN | ||
Repository/R-Forge/Project: simecol | ||
Repository/R-Forge/Revision: 233 | ||
Repository/R-Forge/DateTimeStamp: 2013-09-15 19:31:06 | ||
Date/Publication: 2013-09-26 16:46:19 | ||
Packaged: 2013-09-15 22:16:17 UTC; rforge | ||
Packaged: 2015-03-19 22:26:59 UTC; thpe | ||
NeedsCompilation: yes | ||
Repository: CRAN | ||
Date/Publication: 2015-03-20 00:10:09 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
## special versions of approx: | ||
## approxTime: interpolation of complete rows of a matrix or data frame | ||
## approxTime1: special case with one row only (slightly faster) | ||
|
||
approxTime1 <- function (x, xout, rule = 1) { | ||
if (!is.matrix(x)) x <- as.matrix(x) | ||
if ((!is.numeric(xout)) | (length(xout) != 1)) | ||
stop("xout must be a scalar numeric value") | ||
if ((!is.numeric(rule)) | (length(rule) != 1)) | ||
stop("rule must be a scalar numeric value") | ||
|
||
n <- nrow(x) | ||
if (xout >= x[n, 1]) { | ||
y <- c(xout, x[n, -1]) | ||
if (rule == 1 & (xout > x[n + 1])) | ||
y[2:length(y)] <- NA | ||
} | ||
else if (xout <= x[1, 1]) { | ||
y <- c(xout, x[1, -1]) | ||
if (rule == 1 & (xout < x[1])) | ||
y[2:length(y)] <- NA | ||
} | ||
else { | ||
i <- which.max(x[, 1] > xout) | ||
x1 <- x[i - 1, 1] | ||
x2 <- x[i, 1] | ||
y1 <- x[i - 1, ] | ||
y2 <- x[i, ] | ||
y <- y1 + (y2 - y1) * (xout - x1)/(x2 - x1) | ||
} | ||
names(y) <- dimnames(x)[[2]] | ||
y | ||
} | ||
## special versions of approx: | ||
## approxTime: interpolation of complete rows of a matrix or data frame | ||
## approxTime1: special case with one row only (slightly faster) | ||
|
||
approxTime1 <- function (x, xout, rule = 1) { | ||
if (!is.matrix(x)) x <- as.matrix(x) | ||
if ((!is.numeric(xout)) | (length(xout) != 1)) | ||
stop("xout must be a scalar numeric value") | ||
if ((!is.numeric(rule)) | (length(rule) != 1)) | ||
stop("rule must be a scalar numeric value") | ||
|
||
n <- nrow(x) | ||
if (xout >= x[n, 1]) { | ||
y <- c(xout, x[n, -1]) | ||
if (rule == 1 & (xout > x[n + 1])) | ||
y[2:length(y)] <- NA | ||
} | ||
else if (xout <= x[1, 1]) { | ||
y <- c(xout, x[1, -1]) | ||
if (rule == 1 & (xout < x[1])) | ||
y[2:length(y)] <- NA | ||
} | ||
else { | ||
i <- which.max(x[, 1] > xout) | ||
x1 <- x[i - 1, 1] | ||
x2 <- x[i, 1] | ||
y1 <- x[i - 1, ] | ||
y2 <- x[i, ] | ||
y <- y1 + (y2 - y1) * (xout - x1)/(x2 - x1) | ||
} | ||
names(y) <- dimnames(x)[[2]] | ||
y | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.