Skip to content
Snippets Groups Projects
Commit 9537f56a authored by Sebastian Henz's avatar Sebastian Henz
Browse files

Merge branch 'first-release' into 'master'

Last changes for first public version. Closes #11.

See merge request !12
parents 6c102d7b 84110a4f
No related branches found
No related tags found
2 merge requests!13merge changes from master into v2.0,!12First release
......@@ -4,3 +4,4 @@
^\.Rproj\.user$
^LICENSE\.md$
^Notizen\.md$
^LICENSE\.txt$
......@@ -2,7 +2,7 @@ Package: stressaddition
Type: Package
Title: Modeling Tri-Phasic Concentration-Response Relationships
Version: 1.11.1
Date: 2020-02-04
Date: 2020-02-13
Authors@R: person("Sebastian", "Henz", role = c("aut", "cre"),
email = "sebastian.henz@ufz.de",
comment = c(ORCID = "0000-0001-8299-8852"))
......@@ -10,8 +10,8 @@ Description: The implementation of the tri-phasic concentration-response model
introduced in "Predicting low-concentration effects of pesticides" by
Liess, Henz and Knillmann (2019) <doi: 10.1038/s41598-019-51645-4>. It
allows modeling of ecotoxicological experiments where the response shows
signs of a hormesis effect.
License: none yet
signs of hormesis.
License: GPL-3
URL: https://git.ufz.de/oekotox/stressaddition
Encoding: UTF-8
LazyData: true
......
This diff is collapsed.
# stressaddition 1.11.1
* First public version.
* Added a `NEWS.md` file to track changes to the package.
......@@ -53,5 +53,5 @@ ec <- function(model, effect_name, target_effect) {
dist <- (target_effect - effect[below]) / (effect[above] - effect[below])
output$concentration <- dist *
(concentration[above] - concentration[below]) + concentration[below]
return(output)
output
}
......@@ -124,8 +124,7 @@ ecxsys <- function(concentration,
stop("effect_max must be >= 0")
}
if (length(concentration) != length(effect_tox_observed)) {
stop("concentration and effect_tox_observed must have the ",
"same length.")
stop("concentration and effect_tox_observed must have the same length.")
}
if (length(concentration) > length(unique(concentration))) {
stop("Concentrations must be unique.")
......@@ -139,8 +138,8 @@ ecxsys <- function(concentration,
stop("Use either hormesis_concentration or hormesis_index but not both.")
} else if (!m_hc) {
if (!hormesis_concentration %in% concentration) {
stop("hormesis_concentration must be one of the values in ",
"concentration.")
stop("hormesis_concentration must be one of the values ",
"in concentration.")
}
hormesis_index = which(hormesis_concentration == concentration)
}
......@@ -162,8 +161,8 @@ ecxsys <- function(concentration,
all_observations <- effect_tox_observed
if (with_env) {
if (length(effect_tox_observed) != length(effect_tox_env_observed)) {
stop("effect_tox_observed and effect_tox_env_observed must have the ",
"same length.")
stop("effect_tox_observed and effect_tox_env_observed must have ",
"the same length.")
}
all_observations <- c(all_observations, effect_tox_env_observed)
}
......@@ -172,8 +171,7 @@ ecxsys <- function(concentration,
}
if (any(all_observations > effect_max) ||
any(all_observations < 0)) {
stop("Observed effect must be between 0 and ",
"effect_max.")
stop("Observed effect must be between 0 and effect_max.")
}
conc_shift <- 2 # Powers of ten to shift the control downwards from the
# second lowest concentration. This is required to approximate 0 because
......@@ -483,9 +481,6 @@ ecxsys <- function(concentration,
# also be broken in two. The left part of the axis is supposed to be at
# 0 but because it's a log axis I have to make the values just really
# small. The concentrations in the gap won't be used for plotting later.
# TODO: Also return the LL.5-curves with and without env.
n_smooth <- 1000 # number of points to approximate the curves
concentration_smooth <- 10 ^ seq(
log10(min_conc * conc_adjust_factor),
......@@ -496,8 +491,7 @@ ecxsys <- function(concentration,
output$curves$use_for_plotting <-
concentration_smooth < min_conc * conc_adjust_factor * 1.5 |
concentration_smooth > min_conc * 1.5
return(output)
output
}
......
File moved
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment