From 512cd50874b060d50a14d28df88018ac144cf6d3 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 7 Jul 2020 12:36:56 +0200 Subject: Remove copyright headers, update TOXSWA_cwa test - The window column of the windows component of a TOXSWA_cwa object is not a factor any more, but a character vector. - testthat::expect_equal_to_reference is replaced by testthat::expect_known_output, so we can have git diff show what has changed --- R/FOMC_actual_twa.R | 17 ----------------- R/GUS.R | 17 ----------------- R/PEC_soil.R | 17 ----------------- R/PEC_sw_drainage_UK.R | 17 ----------------- R/PEC_sw_drift.R | 17 ----------------- R/PEC_sw_sed.R | 17 ----------------- R/SFO_actual_twa.R | 17 ----------------- R/SSLRC_mobility_classification.R | 17 ----------------- R/TOXSWA_cwa.R | 16 ---------------- R/geomean.R | 17 ----------------- R/twa.R | 28 +++++----------------------- 11 files changed, 5 insertions(+), 192 deletions(-) (limited to 'R') diff --git a/R/FOMC_actual_twa.R b/R/FOMC_actual_twa.R index dc869b5..0ccf315 100644 --- a/R/FOMC_actual_twa.R +++ b/R/FOMC_actual_twa.R @@ -1,20 +1,3 @@ -# Copyright (C) 2018 Johannes Ranke -# Contact: jranke@uni-bremen.de -# This file is part of the R package pfm - -# This program 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 - #' Actual and maximum moving window time average concentrations for FOMC kinetics #' #' @param alpha Parameter of the FOMC model diff --git a/R/GUS.R b/R/GUS.R index 4a6532d..040857a 100644 --- a/R/GUS.R +++ b/R/GUS.R @@ -1,20 +1,3 @@ -# Copyright (C) 2015 Johannes Ranke -# Contact: jranke@uni-bremen.de -# This file is part of the R package pfm - -# This program 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 - #' Groundwater ubiquity score based on Gustafson (1989) #' #' The groundwater ubiquity score GUS is calculated according to diff --git a/R/PEC_soil.R b/R/PEC_soil.R index 541184f..b29ff13 100644 --- a/R/PEC_soil.R +++ b/R/PEC_soil.R @@ -1,20 +1,3 @@ -# Copyright (C) 2015,2016,2018,2019 Johannes Ranke -# Contact: jranke@uni-bremen.de -# This file is part of the R package pfm - -# This program 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 - # Register global variables if(getRversion() >= '2.15.1') utils::globalVariables(c("destination", "study_type", "TP_identifier", "soil_scenario_data_EFSA_2015", diff --git a/R/PEC_sw_drainage_UK.R b/R/PEC_sw_drainage_UK.R index 3be4c97..d773f40 100644 --- a/R/PEC_sw_drainage_UK.R +++ b/R/PEC_sw_drainage_UK.R @@ -1,20 +1,3 @@ -# Copyright (C) 2015 Johannes Ranke -# Contact: jranke@uni-bremen.de -# This file is part of the R package pfm - -# This program 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 - #' Calculate initial predicted environmental concentrations in surface water due to drainage using the UK method #' #' This implements the method specified in the UK data requirements handbook and was checked against the spreadsheet diff --git a/R/PEC_sw_drift.R b/R/PEC_sw_drift.R index 261706c..6fcaecf 100644 --- a/R/PEC_sw_drift.R +++ b/R/PEC_sw_drift.R @@ -1,20 +1,3 @@ -# Copyright (C) 2015 Johannes Ranke -# Contact: jranke@uni-bremen.de -# This file is part of the R package pfm - -# This program 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 - #' Calculate predicted environmental concentrations in surface water due to drift #' #' This is a basic, vectorised form of a simple calculation of a contaminant diff --git a/R/PEC_sw_sed.R b/R/PEC_sw_sed.R index a4a3d6a..2865ab7 100644 --- a/R/PEC_sw_sed.R +++ b/R/PEC_sw_sed.R @@ -1,20 +1,3 @@ -# Copyright (C) 2015 Johannes Ranke -# Contact: jranke@uni-bremen.de -# This file is part of the R package pfm - -# This program 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 - #' Calculate predicted environmental concentrations in sediment from surface #' water concentrations #' diff --git a/R/SFO_actual_twa.R b/R/SFO_actual_twa.R index 0d2015b..63a53f3 100644 --- a/R/SFO_actual_twa.R +++ b/R/SFO_actual_twa.R @@ -1,20 +1,3 @@ -# Copyright (C) 2015,2018 Johannes Ranke -# Contact: jranke@uni-bremen.de -# This file is part of the R package pfm - -# This program 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 - #' Actual and maximum moving window time average concentrations for SFO kinetics #' #' @param DT50 The half-life. diff --git a/R/SSLRC_mobility_classification.R b/R/SSLRC_mobility_classification.R index 602f166..b78de98 100644 --- a/R/SSLRC_mobility_classification.R +++ b/R/SSLRC_mobility_classification.R @@ -1,20 +1,3 @@ -# Copyright (C) 2015,2018,2019 Johannes Ranke -# Contact: jranke@uni-bremen.de -# This file is part of the R package pfm - -# This program 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 - #' Determine the SSLRC mobility classification for a chemical substance from its Koc #' #' This implements the method specified in the UK data requirements handbook and was diff --git a/R/TOXSWA_cwa.R b/R/TOXSWA_cwa.R index 5b1e8f2..42cdd35 100644 --- a/R/TOXSWA_cwa.R +++ b/R/TOXSWA_cwa.R @@ -1,19 +1,3 @@ -# Copyright (C) 2014,2015,2016,2017,2018 Johannes Ranke -# Contact: jranke@uni-bremen.de -# This file is part of the R package pfm - -# This program 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 if(getRversion() >= '2.15.1') utils::globalVariables(c("cwa")) #' Read TOXSWA surface water concentrations diff --git a/R/geomean.R b/R/geomean.R index 04328c8..34c5caf 100644 --- a/R/geomean.R +++ b/R/geomean.R @@ -1,20 +1,3 @@ -# Copyright (C) 2015,2020 Johannes Ranke -# Contact: jranke@uni-bremen.de -# This file is part of the R package pfm - -# This program 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 - #' Calculate the geometric mean #' #' Based on some posts in a thread on Stackoverflow diff --git a/R/twa.R b/R/twa.R index 59fc73a..886351d 100644 --- a/R/twa.R +++ b/R/twa.R @@ -1,28 +1,10 @@ -# Copyright (C) 2016,2017 Johannes Ranke - -# Contact: jranke@uni-bremen.de -# This file is part of the R package pfm - -# This program 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 - #' Create a time series of decline data #' #' @param x When numeric, this is the half-life to be used for an exponential #' decline. When a character string specifying a parent decline model is given #' e.g. \code{FOMC}, \code{parms} must contain the corresponding parameters. #' If x is an \code{\link{mkinfit}} object, the decline is calculated from this -#' object. +#' object. #' @param ini The initial amount. If x is an \code{\link{mkinfit}} object, and #' ini is 'model', the fitted initial concentrations are used. Otherwise, ini #' must be numeric. If it has length one, it is used for the parent and @@ -93,7 +75,7 @@ one_box.character <- function(x, ini = 1, parms, ..., t_out <- seq(0, t_end, by = res) pred <- mkinpredict(m, odeparms = parms, odeini = c(parent = ini), - outtimes = t_out, solution_type = "analytical")[-1] + outtimes = t_out, solution_type = "analytical")[, -1, drop = FALSE] result <- ts(pred, 0, t_end, frequency = 1/res) class(result) <- c("one_box", "ts") return(result) @@ -118,7 +100,7 @@ one_box.mkinfit <- function(x, ini = "model", ..., t_end = 100, res = 0.01) { else solution_type = "deSolve" tmp <- mkinpredict(fit$mkinmod, odeparms = fit$bparms.ode, odeini = odeini, - outtimes = t_out, solution_type = solution_type)[-1] + outtimes = t_out, solution_type = solution_type)[, -1, drop = FALSE] result <- ts(tmp, 0, t_end, frequency = 1/res) class(result) <- c("one_box", "ts") return(result) @@ -172,7 +154,7 @@ plot.one_box <- function(x, #' Create decline time series for multiple applications #' -#' If the application pattern is specified in \code{applications}, +#' If the application pattern is specified in \code{applications}, #' \code{n} and \code{i} are disregarded. #' @param x A \code{\link{one_box}} object #' @param n The number of applications. If \code{applications} is specified, \code{n} is ignored @@ -260,7 +242,7 @@ twa.one_box <- function(x, window = 21) #' for finding the maximum. It is therefore recommended to check this using #' \code{\link{plot.one_box}} using the window size for the argument #' \code{max_twa}. -#' +#' #' The method working directly on fitted \code{\link{mkinfit}} objects uses the #' equations given in the PEC soil section of the FOCUS guidance and is restricted #' SFO, FOMC and DFOP models and to the parent compound -- cgit v1.2.1