From ec2052d68950745380c2724757b3ba8b116605fc Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 8 Jun 2018 14:54:40 +0200 Subject: Add actual/twa calcs for FOMC, typo --- ChangeLog | 24 ++++++++++++++++++++++++ DESCRIPTION | 2 +- NAMESPACE | 1 + R/FOMC_actual_twa.R | 36 ++++++++++++++++++++++++++++++++++++ R/SFO_actual_twa.R | 4 ++-- man/FOMC_actual_twa.Rd | 30 ++++++++++++++++++++++++++++++ man/SFO_actual_twa.Rd | 2 +- 7 files changed, 95 insertions(+), 4 deletions(-) create mode 100644 R/FOMC_actual_twa.R create mode 100644 man/FOMC_actual_twa.Rd diff --git a/ChangeLog b/ChangeLog index c715b62..f20f718 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +commit 7dc0ba4228fa490631b543c193ad7f113d703f00 +Author: Johannes Ranke +Date: 2018-06-08 14:54:40 +0200 + + Add actual/twa calcs for FOMC, typo + +commit edc3462fb4fa9f0eb604fc18ec62bb48997b5627 +Author: Johannes Ranke +Date: 2018-06-08 14:53:58 +0200 + + Pending stuff from the doc update + +commit 197606de234a936751ac3c1db2e4feb3fa117a92 +Author: Johannes Ranke +Date: 2018-06-06 02:48:44 +0200 + + Rebuild docs with pkgdown 1.1.0 + +commit 282820693c62b958e12104f4bb6229c04803f098 +Author: Johannes Ranke +Date: 2018-03-01 10:32:08 +0100 + + Add a README.html for cgit.jrwb.de + commit 6d8de73e68f2c0349e618af35ce4a8f095ca0ed5 Author: Johannes Ranke Date: 2018-03-01 10:10:08 +0100 diff --git a/DESCRIPTION b/DESCRIPTION index 5695281..96aea24 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: pfm Type: Package Title: Utilities for Pesticide Fate Modelling Version: 0.4-5 -Date: 2018-03-05 +Date: 2018-06-08 Authors@R: person("Johannes Ranke", email = "jranke@uni-bremen.de", role = c("aut", "cre", "cph"), comment = c(ORCID = "0000-0003-4371-6538")) diff --git a/NAMESPACE b/NAMESPACE index ddf73dd..229ea70 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -15,6 +15,7 @@ export(FOCUS_GW_scenarios_2012) export(FOCUS_PELMO_crop_sze_names) export(FOCUS_PELMO_crops) export(FOCUS_PELMO_location_codes) +export(FOMC_actual_twa) export(GUS) export(PEC_soil) export(PEC_sw_drainage_UK) diff --git a/R/FOMC_actual_twa.R b/R/FOMC_actual_twa.R new file mode 100644 index 0000000..dc869b5 --- /dev/null +++ b/R/FOMC_actual_twa.R @@ -0,0 +1,36 @@ +# 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 +#' @param beta Parameter of the FOMC model +#' @param times The output times, and window sizes for time weighted average concentrations +#' @export +#' @author Johannes Ranke +#' @source FOCUS (2014) Generic Guidance for Estimating Persistence and Degradation +#' Kinetics from Environmental Fate Studies on Pesticides in EU Registration, Version 1.1, +#' 18 December 2014, p. 251 +#' @examples +#' FOMC_actual_twa(alpha = 1.0001, beta = 10) +FOMC_actual_twa <- function(alpha = 1.0001, beta = 10, times = c(0, 1, 2, 4, 7, 14, 21, 28, 42, 50, 100)) +{ + result <- data.frame(actual = 1 / (times/beta + 1)^alpha, + twa = (beta / (times * (1 - alpha))) * (((times / beta) + 1)^(1 - alpha) - 1), + row.names = times) + return(result) +} diff --git a/R/SFO_actual_twa.R b/R/SFO_actual_twa.R index 7facb6a..0d2015b 100644 --- a/R/SFO_actual_twa.R +++ b/R/SFO_actual_twa.R @@ -1,4 +1,4 @@ -# Copyright (C) 2015 Johannes Ranke +# Copyright (C) 2015,2018 Johannes Ranke # Contact: jranke@uni-bremen.de # This file is part of the R package pfm @@ -22,7 +22,7 @@ #' @export #' @author Johannes Ranke #' @source FOCUS (2014) Generic Guidance for Estimating Persistence and Degradation -#' Kinetics from Environmental Fate Studies on Pesticides in EU Registratin, Version 1.1, +#' Kinetics from Environmental Fate Studies on Pesticides in EU Registration, Version 1.1, #' 18 December 2014, p. 251 #' @examples #' SFO_actual_twa(10) diff --git a/man/FOMC_actual_twa.Rd b/man/FOMC_actual_twa.Rd new file mode 100644 index 0000000..7a1f0fb --- /dev/null +++ b/man/FOMC_actual_twa.Rd @@ -0,0 +1,30 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/FOMC_actual_twa.R +\name{FOMC_actual_twa} +\alias{FOMC_actual_twa} +\title{Actual and maximum moving window time average concentrations for FOMC kinetics} +\source{ +FOCUS (2014) Generic Guidance for Estimating Persistence and Degradation + Kinetics from Environmental Fate Studies on Pesticides in EU Registration, Version 1.1, + 18 December 2014, p. 251 +} +\usage{ +FOMC_actual_twa(alpha = 1.0001, beta = 10, times = c(0, 1, 2, 4, 7, 14, + 21, 28, 42, 50, 100)) +} +\arguments{ +\item{alpha}{Parameter of the FOMC model} + +\item{beta}{Parameter of the FOMC model} + +\item{times}{The output times, and window sizes for time weighted average concentrations} +} +\description{ +Actual and maximum moving window time average concentrations for FOMC kinetics +} +\examples{ +FOMC_actual_twa(alpha = 1.0001, beta = 10) +} +\author{ +Johannes Ranke +} diff --git a/man/SFO_actual_twa.Rd b/man/SFO_actual_twa.Rd index 61f95aa..720fbc9 100644 --- a/man/SFO_actual_twa.Rd +++ b/man/SFO_actual_twa.Rd @@ -5,7 +5,7 @@ \title{Actual and maximum moving window time average concentrations for SFO kinetics} \source{ FOCUS (2014) Generic Guidance for Estimating Persistence and Degradation - Kinetics from Environmental Fate Studies on Pesticides in EU Registratin, Version 1.1, + Kinetics from Environmental Fate Studies on Pesticides in EU Registration, Version 1.1, 18 December 2014, p. 251 } \usage{ -- cgit v1.2.1