diff --git a/DESCRIPTION b/DESCRIPTION index 067dcb630cb34a0be949cbf33d07ecd6a640525b..8610a2b08012c934edfcb5b64b782a98315e9f1d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: stressaddition Type: Package Title: Modeling Tri-Phasic Concentration-Response Relationships -Version: 2.2.0 -Date: 2020-02-28 +Version: 2.2.1 +Date: 2020-03-03 Authors@R: c(person("Sebastian", "Henz", role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index 1379a56a09ad3cca342561132b776270b57c6029..b954e4d6be1cda2075ff18af1db1fa5baebe4fde 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# stressaddition 2.2.1 + +* Improve documentation of `predict_mixture()` and include example of symmetry. + # stressaddition 2.2.0 * `ec()` raises an error if the curve does not cross the desired response level. diff --git a/R/ec.R b/R/ec.R index 5fb444b30e798ce454c945ff604d288585a22fb1..69c9da6740adf5cb0de2746748de57ba96a3dbcc 100644 --- a/R/ec.R +++ b/R/ec.R @@ -1,3 +1,22 @@ +# Copyright (C) 2020 Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ +# See file inst/COPYRIGHTS for details. +# +# This file is part of the R package stressaddition. +# +# stressaddition is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + + #' Effect Concentrations #' #' Estimate the concentration to reach a certain effect or stress level relative diff --git a/R/ecxsys.R b/R/ecxsys.R index ccab533eafee1993663dd74c0e14e9504273c47c..d6ba1a7a4618efa91a3c32ed96bf5587487bda30 100644 --- a/R/ecxsys.R +++ b/R/ecxsys.R @@ -1,3 +1,22 @@ +# Copyright (C) 2020 Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ +# See file inst/COPYRIGHTS for details. +# +# This file is part of the R package stressaddition. +# +# stressaddition is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + + # Note about the setting and resetting of options: # The drc package changes some of the options which some users may have # modified. Of particular interest is options("warn") because it is important diff --git a/R/helpers.R b/R/helpers.R index a34ae96fcbe3874d3cf61b3f3019e6d5d37f4129..acdfaff8f3338c13dd67c7e018cc29e5c872d740 100644 --- a/R/helpers.R +++ b/R/helpers.R @@ -1,4 +1,23 @@ -# A collection of internal helper functions which get used in more than one place. +# Copyright (C) 2020 Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ +# See file inst/COPYRIGHTS for details. +# +# This file is part of the R package stressaddition. +# +# stressaddition is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + + +# A collection of some internal helper functions. clamp <- function(x, lower = 0, upper = 1) { diff --git a/R/plot_ecxsys.R b/R/plot_ecxsys.R index 18a31e67edf2e11215e40f180023411f7498de84..52a812ca66b4c61da63c89f5af78837130691d05 100644 --- a/R/plot_ecxsys.R +++ b/R/plot_ecxsys.R @@ -1,4 +1,23 @@ -# This is the shared documentation for the plotting functions +# Copyright (C) 2020 Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ +# See file inst/COPYRIGHTS for details. +# +# This file is part of the R package stressaddition. +# +# stressaddition is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + + +# This is the shared documentation for the plotting functions. #' Plot the results of the ECx-SyS model diff --git a/R/plot_effect.R b/R/plot_effect.R index b9075a1f12fb7a1fe86f8cc8307ab3937637fe9a..5a0da15f0b2de26ec4e4f6bd12fd31b8b5f8542b 100644 --- a/R/plot_effect.R +++ b/R/plot_effect.R @@ -1,3 +1,22 @@ +# Copyright (C) 2020 Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ +# See file inst/COPYRIGHTS for details. +# +# This file is part of the R package stressaddition. +# +# stressaddition is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + + #' @rdname plot_ecxsys #' @export plot_effect <- function(model, diff --git a/R/plot_stress.R b/R/plot_stress.R index 62979cdcc97f32c3c672ba96c1013eb67f17b159..ee80cd49846519fae905291dd778af08b160c2c8 100644 --- a/R/plot_stress.R +++ b/R/plot_stress.R @@ -1,3 +1,22 @@ +# Copyright (C) 2020 Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ +# See file inst/COPYRIGHTS for details. +# +# This file is part of the R package stressaddition. +# +# stressaddition is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + + #' @rdname plot_ecxsys #' @export plot_stress <- function(model, diff --git a/R/predict_ecxsys.R b/R/predict_ecxsys.R index 7d3d82a5a48eac83aff288cc68771a56ba007272..567ac6705c655036cb1815e342dc27fe3a8f9107 100644 --- a/R/predict_ecxsys.R +++ b/R/predict_ecxsys.R @@ -1,3 +1,22 @@ +# Copyright (C) 2020 Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ +# See file inst/COPYRIGHTS for details. +# +# This file is part of the R package stressaddition. +# +# stressaddition is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + + #' Predict effects and stresses #' #' Calculate the effects and stresses of an ECx-SyS model at arbitrary diff --git a/R/predict_mixture.R b/R/predict_mixture.R index a9d343451e40f22d18acbd5a4ee66f706d6612a5..f70f6a60e381d8cdd0de15759dd3ac24a83fe7e3 100644 --- a/R/predict_mixture.R +++ b/R/predict_mixture.R @@ -1,5 +1,35 @@ +# Copyright (C) 2020 Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ +# See file inst/COPYRIGHTS for details. +# +# This file is part of the R package stressaddition. +# +# stressaddition is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + + #' Predict the effect of a mixture of two toxicants #' +#' Given the ecxsys models of two toxicants this method predicts the effects of +#' different mixtures of both. +#' +#' The prediction happens at one or multiple concentrations of toxicant 1 and +#' one concentration of toxicant 2. This allows for easy plotting over the +#' concentrations of toxicant 1. +#' +#' The predictions are symmetric, i.e. it does not matter which of the toxicant +#' models is 1 or 2 as long as the concentration arguments are supplied +#' in the right order. See the example below. +#' #' This method is only suitable for experiments without environmental stress. #' Any environmental stress in \code{model_1} or \code{model_2} is ignored. #' @@ -13,23 +43,39 @@ #' @return A vector of the effects of the mixture, scaled to the effect_max #' value of model_1. #' -#' @examples toxicant_model_1 <- ecxsys( +#' @examples toxicant_1 <- ecxsys( #' concentration = c(0, 0.05, 0.5, 5, 30), #' hormesis_concentration = 0.5, #' effect_tox_observed = c(90, 81, 92, 28, 0), #' ) -#' toxicant_model_2 <- ecxsys( +#' toxicant_2 <- ecxsys( #' concentration = c(0, 0.1, 1, 10, 100, 1000), #' hormesis_concentration = 10, #' effect_tox_observed = c(26, 25, 24, 27, 5, 0), #' effect_max = 30 #' ) #' predict_mixture( -#' toxicant_model_1, -#' toxicant_model_2, +#' toxicant_1 , +#' toxicant_2 , #' c(0, 0.02, 0.2, 2, 20), #' 3 #' ) +#' +#' # Example of symmetric prediction: +#' conc_1 <- c(0, 0.03, 0.3, 3) +#' conc_2 <- 5.5 +#' prop_ca <- 0.75 +#' effect_a <- predict_mixture(toxicant_1 , toxicant_2 , conc_1, conc_2, prop_ca) +#' effect_b <- sapply( +#' conc_1, +#' function(x) predict_mixture(toxicant_2 , toxicant_1 , conc_2, x, prop_ca) +#' ) +#' # The effect_max values of the models are different. effect_b is scaled to +#' # the one from toxicant 2 but to compare the results effect_b must be scaled +#' # to the effect_max of toxicant 1: +#' effect_b <- effect_b / toxicant_2 $args$effect_max * toxicant_1$args$effect_max +#' identical(effect_a, effect_b) +#' #' @export predict_mixture <- function(model_1, model_2, diff --git a/R/stress_effect_conversion.R b/R/stress_effect_conversion.R index ef6c252dbfc73d317fa09f863ef0a7339fc7cf17..49dcc5bee474f69fa2ec6c2646f09890841c8aae 100644 --- a/R/stress_effect_conversion.R +++ b/R/stress_effect_conversion.R @@ -1,3 +1,22 @@ +# Copyright (C) 2020 Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ +# See file inst/COPYRIGHTS for details. +# +# This file is part of the R package stressaddition. +# +# stressaddition is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + + #' Convert Between Stress and Effect #' #' Functions to convert effect to general stress or vice versa using the beta diff --git a/R/stressaddition-package.R b/R/stressaddition-package.R index 16dd5a0e6bbfcfda8ecde00bde026d6f22817745..abd7efacbf55d6e5cb8a4e8ba5a093e390c8239f 100644 --- a/R/stressaddition-package.R +++ b/R/stressaddition-package.R @@ -1,6 +1,26 @@ +# Copyright (C) 2020 Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ +# See file inst/COPYRIGHTS for details. +# +# This file is part of the R package stressaddition. +# +# stressaddition is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + + # The help file for the package, accessible via ?stressaddition and # ?`stressaddition-package`. Some people recommend using "@keywords internal" -# here to exclude this page from the help index but I'm not going to do that. +# here to exclude this page from the help index. But I'm not going to do that +# because I want to keep it on the index. # "_PACKAGE" automatically populates most sections in this package # documentation, so I don't need to manually fill in authors, title or diff --git a/README.md b/README.md index 7ffe0649aa53712860fabd0beeebf193674c3358..426439e62241bc939ef227cc15fc779c37fa4fc7 100644 --- a/README.md +++ b/README.md @@ -43,3 +43,32 @@ ec(model, "effect_tox_sys", 50) # The LC10 of the effect under the influence of toxicant, system and environmental tress: ec(model, "effect_tox_env_sys", 10) ``` + +## Copyright and License +Copyright (c) 2020, +Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ. +All rights reserved. + +The code is a property of: + +Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ +Registered Office: Leipzig +Registration Office: Amtsgericht Leipzig +Trade Register: Nr. B 4703 +Chairman of the Supervisory Board: MinDirig'in Oda Keppler +Scientific Director: Prof. Dr. Georg Teutsch +Administrative Director: Dr. Sabine König + + +stressaddition is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <https://www.gnu.org/licenses/>. diff --git a/man/predict_mixture.Rd b/man/predict_mixture.Rd index bc43850edd096f54a6841cf3d35623ca6920fc86..8595ac80da97ffe27d7fcc38bd4e9361212800cc 100644 --- a/man/predict_mixture.Rd +++ b/man/predict_mixture.Rd @@ -29,25 +29,53 @@ A vector of the effects of the mixture, scaled to the effect_max value of model_1. } \description{ +Given the ecxsys models of two toxicants this method predicts the effects of +different mixtures of both. +} +\details{ +The prediction happens at one or multiple concentrations of toxicant 1 and +one concentration of toxicant 2. This allows for easy plotting over the +concentrations of toxicant 1. + +The predictions are symmetric, i.e. it does not matter which of the toxicant +models is 1 or 2 as long as the concentration arguments are supplied +in the right order. See the example below. + This method is only suitable for experiments without environmental stress. Any environmental stress in \code{model_1} or \code{model_2} is ignored. } \examples{ -toxicant_model_1 <- ecxsys( +toxicant_1 <- ecxsys( concentration = c(0, 0.05, 0.5, 5, 30), hormesis_concentration = 0.5, effect_tox_observed = c(90, 81, 92, 28, 0), ) -toxicant_model_2 <- ecxsys( +toxicant_2 <- ecxsys( concentration = c(0, 0.1, 1, 10, 100, 1000), hormesis_concentration = 10, effect_tox_observed = c(26, 25, 24, 27, 5, 0), effect_max = 30 ) predict_mixture( - toxicant_model_1, - toxicant_model_2, + toxicant_1 , + toxicant_2 , c(0, 0.02, 0.2, 2, 20), 3 ) + +# Example of symmetric prediction: +conc_1 <- c(0, 0.03, 0.3, 3) +conc_2 <- 5.5 +prop_ca <- 0.75 +effect_a <- predict_mixture(toxicant_1 , toxicant_2 , conc_1, conc_2, prop_ca) +effect_b <- sapply( + conc_1, + function(x) predict_mixture(toxicant_2 , toxicant_1 , conc_2, x, prop_ca) +) +# The effect_max values of the models are different. effect_b is scaled to +# the one from toxicant 2 but to compare the results effect_b must be scaled +# to the effect_max of toxicant 1: +effect_b <- effect_b / toxicant_2 $args$effect_max * toxicant_1$args$effect_max +identical(effect_a, effect_b) + } diff --git a/tests/testthat.R b/tests/testthat.R index 1f87a9a9c20da7a69b927240ded0742051c95a6d..d350fe5adfc8e4013f79c439bb975924ac5ceff2 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,3 +1,22 @@ +# Copyright (C) 2020 Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ +# See file inst/COPYRIGHTS for details. +# +# This file is part of the R package stressaddition. +# +# stressaddition is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + + library(testthat) library(stressaddition) diff --git a/tests/testthat/test-ec.R b/tests/testthat/test-ec.R index 138fbcedafabfcdfa9bc1508bb6d7a2fc73a048e..0371c7d868c98e881cc7dc79309a44871a78c467 100644 --- a/tests/testthat/test-ec.R +++ b/tests/testthat/test-ec.R @@ -1,3 +1,22 @@ +# Copyright (C) 2020 Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ +# See file inst/COPYRIGHTS for details. +# +# This file is part of the R package stressaddition. +# +# stressaddition is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + + test_that("all input formats produce identical models", { model <- ecxsys( concentration = c(0, 0.05, 0.5, 5, 30), diff --git a/tests/testthat/test-ecxsys.R b/tests/testthat/test-ecxsys.R index 9911f1d825f21f80ac2989531442ef68e1906c00..01dcd29941a74c9616a370f3fd537601a2665b6f 100644 --- a/tests/testthat/test-ecxsys.R +++ b/tests/testthat/test-ecxsys.R @@ -1,3 +1,22 @@ +# Copyright (C) 2020 Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ +# See file inst/COPYRIGHTS for details. +# +# This file is part of the R package stressaddition. +# +# stressaddition is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + + mod <- ecxsys( concentration = c(0, 0.05, 0.5, 5, 30), hormesis_concentration = 0.5, diff --git a/tests/testthat/test-options.R b/tests/testthat/test-options.R index 6d7c85d1db31a21e9bd235a7c173fcb26fd6b8e1..2ff4a81632c9269b53a79b06c98ffb4054376f4f 100644 --- a/tests/testthat/test-options.R +++ b/tests/testthat/test-options.R @@ -1,3 +1,22 @@ +# Copyright (C) 2020 Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ +# See file inst/COPYRIGHTS for details. +# +# This file is part of the R package stressaddition. +# +# stressaddition is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + + test_that("user options are not permanently changed by ecxsys()", { # drc::drm() messes with the options and fails to return them to their # previous values. And options are temporarily modified in ecxsys(). This diff --git a/tests/testthat/test-plot_ecxsys.R b/tests/testthat/test-plot_ecxsys.R index 4a61b99d27c535b04eef909476a1bf6e128d6232..a0dea0a1d6556b76502c4c736e53120584fc2964 100644 --- a/tests/testthat/test-plot_ecxsys.R +++ b/tests/testthat/test-plot_ecxsys.R @@ -1,3 +1,22 @@ +# Copyright (C) 2020 Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ +# See file inst/COPYRIGHTS for details. +# +# This file is part of the R package stressaddition. +# +# stressaddition is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + + test_that("log ticks are correct", { x <- c(0.03, 0.3, 3, 30) ticks <- get_log_ticks(x) diff --git a/tests/testthat/test-predict_mixture.R b/tests/testthat/test-predict_mixture.R index 3471aeb429a0e7cff5f1496d08445e36253eb99f..715697f791ee352f83cbf77a79c15fbd8ff880d1 100644 --- a/tests/testthat/test-predict_mixture.R +++ b/tests/testthat/test-predict_mixture.R @@ -1,3 +1,22 @@ +# Copyright (C) 2020 Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ +# See file inst/COPYRIGHTS for details. +# +# This file is part of the R package stressaddition. +# +# stressaddition is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + + model_1 <- ecxsys( concentration = c(0, 0.05, 0.5, 5, 30), hormesis_concentration = 0.5, diff --git a/tests/testthat/test-stress_effect_conversion.R b/tests/testthat/test-stress_effect_conversion.R index b583ece438293fb19df092d467a5b016054c6c98..e17a2ae4e049c3e33ef3f44d647e3a1367b8a747 100644 --- a/tests/testthat/test-stress_effect_conversion.R +++ b/tests/testthat/test-stress_effect_conversion.R @@ -1,3 +1,22 @@ +# Copyright (C) 2020 Helmholtz-Zentrum fuer Umweltforschung GmbH - UFZ +# See file inst/COPYRIGHTS for details. +# +# This file is part of the R package stressaddition. +# +# stressaddition is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + + test_that("stress_to_effect handles bad input", { expect_equal(stress_to_effect(-3), 1) expect_equal(stress_to_effect(10), 0)