aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/DESCRIPTION6
-rw-r--r--pkg/NAMESPACE3
-rw-r--r--pkg/R/PEC_soil.R15
-rw-r--r--pkg/man/PEC_soil_product.Rd24
-rw-r--r--pkg/man/pfm_ai.Rd24
-rw-r--r--pkg/man/pfm_chent.Rd35
-rw-r--r--pkg/man/pfm_product.Rd26
-rw-r--r--pkg/tests/testthat/test_PEC_soil.R4
8 files changed, 43 insertions, 94 deletions
diff --git a/pkg/DESCRIPTION b/pkg/DESCRIPTION
index 247df20..39d3927 100644
--- a/pkg/DESCRIPTION
+++ b/pkg/DESCRIPTION
@@ -1,8 +1,8 @@
Package: pfm
Type: Package
Title: Utilities for Pesticide Fate Modelling
-Version: 0.2-3.900
-Date: 2015-08-26
+Version: 0.2-4
+Date: 2015-09-11
Authors@R: person("Johannes Ranke", email = "jranke@uni-bremen.de",
role = c("aut", "cre", "cph"))
Description: Utilities for simple calculations of predicted environmental
@@ -10,7 +10,7 @@ Description: Utilities for simple calculations of predicted environmental
fate modelling software packages.
Depends: R6, mkin
Imports: graphics
-Suggests: testthat
+Suggests: testthat, chents
License: GPL
LazyLoad: yes
LazyData: yes
diff --git a/pkg/NAMESPACE b/pkg/NAMESPACE
index 2b7f1d6..a1c5df2 100644
--- a/pkg/NAMESPACE
+++ b/pkg/NAMESPACE
@@ -11,10 +11,7 @@ export(SFO_actual_twa)
export(SSLRC_mobility_classification)
export(TOXSWA_cwa)
export(geomean)
-export(pfm_ai)
-export(pfm_chent)
export(pfm_degradation)
-export(pfm_product)
export(read.TOXSWA_cwa)
import(graphics)
import(mkin)
diff --git a/pkg/R/PEC_soil.R b/pkg/R/PEC_soil.R
index 3c3ae15..fff1f20 100644
--- a/pkg/R/PEC_soil.R
+++ b/pkg/R/PEC_soil.R
@@ -44,12 +44,25 @@ PEC_soil <- function(rate, rate_units = "g/ha", interception = 0,
return(PEC_soil)
}
+if(getRversion() >= '2.15.1') utils::globalVariables(c("destination", "study_type", "TP_identifier"))
#' Calculate predicted environmental concentrations in soil for a product
#'
#' Calculates long term accumulation PEC values
#'
-#' @export
+#' @param product An object of class pp
+#' @param rate Application rate in units specified below
+#' @param rate_units Defaults to g/ha
+#' @param interception The fraction of the application rate that does not reach the soil
+#' @param mixing_depth Mixing depth in cm
+#' @param tillage_depth Periodic (see interval) deeper mixing in cm
+#' @param interval Period of the deeper mixing, defaults to 365, which is a year if
+#' rate units are in days
+#' @param bulk_density Bulk density of the soil. Defaults to 1.5 kg/L, or 1500 kg/m3
+#' @param PEC_units Requested units for the calculated PEC. Only mg/kg currently supported
+#' @return A data frame with compound names, and initial, plateau maximum, plateau minimum (background)
+#' and long term maximum predicted concentrations in soil
+#' @export PEC_soil_product
#' @author Johannes Ranke
PEC_soil_product <- function(product, rate, rate_units = "L/ha", interception = 0,
mixing_depth = 5, tillage_depth = 20,
diff --git a/pkg/man/PEC_soil_product.Rd b/pkg/man/PEC_soil_product.Rd
index b708366..28cb5fd 100644
--- a/pkg/man/PEC_soil_product.Rd
+++ b/pkg/man/PEC_soil_product.Rd
@@ -8,6 +8,30 @@ PEC_soil_product(product, rate, rate_units = "L/ha", interception = 0,
mixing_depth = 5, tillage_depth = 20, interval = 365,
bulk_density = 1.5, PEC_units = "mg/kg")
}
+\arguments{
+\item{product}{An object of class pp}
+
+\item{rate}{Application rate in units specified below}
+
+\item{rate_units}{Defaults to g/ha}
+
+\item{interception}{The fraction of the application rate that does not reach the soil}
+
+\item{mixing_depth}{Mixing depth in cm}
+
+\item{tillage_depth}{Periodic (see interval) deeper mixing in cm}
+
+\item{interval}{Period of the deeper mixing, defaults to 365, which is a year if
+rate units are in days}
+
+\item{bulk_density}{Bulk density of the soil. Defaults to 1.5 kg/L, or 1500 kg/m3}
+
+\item{PEC_units}{Requested units for the calculated PEC. Only mg/kg currently supported}
+}
+\value{
+A data frame with compound names, and initial, plateau maximum, plateau minimum (background)
+ and long term maximum predicted concentrations in soil
+}
\description{
Calculates long term accumulation PEC values
}
diff --git a/pkg/man/pfm_ai.Rd b/pkg/man/pfm_ai.Rd
deleted file mode 100644
index 20c5acd..0000000
--- a/pkg/man/pfm_ai.Rd
+++ /dev/null
@@ -1,24 +0,0 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
-% Please edit documentation in R/pfm_chent.R
-\docType{class}
-\name{pfm_ai}
-\alias{pfm_ai}
-\title{R6 class for holding active ingredients}
-\format{An \code{\link{R6Class}} generator object.}
-\usage{
-pfm_ai
-}
-\description{
-An R6 class for holding information about active ingredients
-}
-\section{Fields}{
-
-\describe{
-\item{\code{iso}}{ISO common name}
-}}
-\examples{
-atrazine <- pfm_ai("atrazine", smiles = "Clc1nc(nc(n1)NC(C)C)NCC", mw = 215.68)
-print(atrazine)
-}
-\keyword{data}
-
diff --git a/pkg/man/pfm_chent.Rd b/pkg/man/pfm_chent.Rd
deleted file mode 100644
index f72d038..0000000
--- a/pkg/man/pfm_chent.Rd
+++ /dev/null
@@ -1,35 +0,0 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
-% Please edit documentation in R/pfm_chent.R
-\docType{class}
-\name{pfm_chent}
-\alias{pfm_chent}
-\title{R6 class for holding a chemical entity}
-\format{An \code{\link{R6Class}} generator object}
-\usage{
-pfm_chent
-}
-\description{
-An R6 class for holding information about a chemical entity that is useful
-for fate modelling
-}
-\section{Fields}{
-
-\describe{
-\item{\code{acronym}}{Acronym for local use}
-
-\item{\code{smiles}}{SMILES code}
-
-\item{\code{mw}}{Molecular weight}
-
-\item{\code{main_source}}{Main source of information}
-
-\item{\code{transformations}}{}
-
-\item{\code{sorption_endpoints}}{}
-}}
-\examples{
-atrazine <- pfm_chent("atrazine", smiles = "Clc1nc(nc(n1)NC(C)C)NCC", mw = 215.68)
-print(atrazine)
-}
-\keyword{data}
-
diff --git a/pkg/man/pfm_product.Rd b/pkg/man/pfm_product.Rd
deleted file mode 100644
index 41ea4aa..0000000
--- a/pkg/man/pfm_product.Rd
+++ /dev/null
@@ -1,26 +0,0 @@
-% Generated by roxygen2 (4.1.1): do not edit by hand
-% Please edit documentation in R/pfm_chent.R
-\docType{class}
-\name{pfm_product}
-\alias{pfm_product}
-\title{R6 class for holding a product with at least one active ingredient}
-\format{An \code{\link{R6Class}} generator object.}
-\usage{
-pfm_product
-}
-\description{
-An R6 class for holding information about a product with at least one active ingredient
-}
-\section{Fields}{
-
-\describe{
-\item{\code{name}}{The name of the product}
-
-\item{\code{ais}}{A list of active ingredients}
-
-\item{\code{concentrations}}{The concentration of the ais}
-
-\item{\code{concentration_units}}{Defaults to g/L}
-}}
-\keyword{data}
-
diff --git a/pkg/tests/testthat/test_PEC_soil.R b/pkg/tests/testthat/test_PEC_soil.R
index 7901b69..27b2eb7 100644
--- a/pkg/tests/testthat/test_PEC_soil.R
+++ b/pkg/tests/testthat/test_PEC_soil.R
@@ -1,5 +1,5 @@
-library(mkin)
-context("Setting up kinetic degradation models")
+library(pfm)
+context("Simple PEC soil calculations")
test_that("PEC_soil calculates correctly", {
# Application of 100 g/ha gives 0.133 mg/kg under default assumptions

Contact - Imprint