From bf535e05f09864d5a88591d55bb8993b0619e57a Mon Sep 17 00:00:00 2001 From: Ranke Johannes Date: Sat, 11 Nov 2023 08:23:28 +0100 Subject: Start new version, rename pp to ppp, more docs --- .Rhistory | 4 + DESCRIPTION | 4 +- NAMESPACE | 2 +- R/chent.R | 204 ++++++++++++++++++------ _pkgdown.yml | 2 +- docs/404.html | 2 +- docs/authors.html | 6 +- docs/index.html | 2 +- docs/pkgdown.yml | 2 +- docs/reference/chent.html | 319 ++++++++++++++++++++++++++++++++++++- docs/reference/draw_svg.chent.html | 2 +- docs/reference/index.html | 6 +- docs/reference/pai.html | 43 +++-- docs/reference/plot.chent.html | 2 +- docs/reference/ppp.html | 194 ++++++++++++++++++++++ docs/reference/print.chent.html | 2 +- docs/reference/print.pai.html | 2 +- docs/sitemap.xml | 3 + man/chent.Rd | 144 ++++++++++++++++- man/pai.Rd | 26 ++- man/pp.Rd | 77 --------- man/ppp.Rd | 100 ++++++++++++ 22 files changed, 982 insertions(+), 166 deletions(-) create mode 100644 .Rhistory create mode 100644 docs/reference/ppp.html delete mode 100644 man/pp.Rd create mode 100644 man/ppp.Rd diff --git a/.Rhistory b/.Rhistory new file mode 100644 index 0000000..1a9e67f --- /dev/null +++ b/.Rhistory @@ -0,0 +1,4 @@ +library(chents) +?chent +library(chents) +?chent diff --git a/DESCRIPTION b/DESCRIPTION index e75912b..879bee7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: chents Type: Package Title: Chemical Entities as R Objects -Version: 0.3.1 -Date: 2023-11-10 +Version: 0.3.2 +Date: 2023-11-11 Authors@R: c(person("Johannes", "Ranke", role = c("aut", "cre", "cph"), email = "johannes.ranke@jrwb.de")) Description: Utilities for dealing with chemical entities and associated diff --git a/NAMESPACE b/NAMESPACE index e6ced73..e56a6c6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -6,7 +6,7 @@ S3method(print,pai) export(chent) export(draw_svg.chent) export(pai) -export(pp) +export(ppp) importFrom(R6,R6Class) importFrom(grImport,PostScriptTrace) importFrom(grImport,grid.picture) diff --git a/R/chent.R b/R/chent.R index dc9be6f..fdad351 100644 --- a/R/chent.R +++ b/R/chent.R @@ -23,6 +23,7 @@ #' if (!is.null(caffeine$Picture)) { #' plot(caffeine) #' } + chent <- R6Class("chent", public = list( #' @field identifier (`character(1)`)\cr @@ -241,6 +242,7 @@ chent <- R6Class("chent", #' @param repo Should the file be looked for in the current working #' directory, a local git repository under `~/git/chyaml`, or from #' the web (not implemented). + #' @param chyaml The filename to be looked for get_chyaml = function(repo = c("wd", "local", "web"), chyaml = paste0(URLencode(self$identifier), ".yaml")) { @@ -287,8 +289,15 @@ chent <- R6Class("chent", }, #' Add a water solubility - #' @param p0 The water solubility in mg/L - add_cwsat = function(cwsat, T = NA, pH = NA, source = NA, page = NA, remark = "") { + #' @param cwsat The water solubility in mg/L + #' @param T Temperature + #' @param pH The pH value + #' @param source An acronym specifying the source of the information + #' @param page The page from which the information was taken + #' @param remark A remark + add_cwsat = function(cwsat, T = NA, pH = NA, + source = NA, page = NA, remark = "") + { self$cwsat <- cwsat attr(self$cwsat, "T") <- T attr(self$cwsat, "pH") <- pH @@ -299,7 +308,13 @@ chent <- R6Class("chent", #' Add a plant uptake factor #' @param PUF The plant uptake factor, a number between 0 and 1 - add_PUF = function(PUF = 0, source = "focus_generic_gw_2014", page = 41, remark = "Conservative default value") { + #' @param source An acronym specifying the source of the information + #' @param page The page from which the information was taken + #' @param remark A remark + add_PUF = function(PUF = 0, + source = "focus_generic_gw_2014", page = 41, + remark = "Conservative default value") + { self$PUF <- PUF attr(self$PUF, "source") <- source attr(self$PUF, "page") <- page @@ -326,13 +341,22 @@ chent <- R6Class("chent", #' @field transformations Data frame of observed transformations transformations = data.frame(study_type = character(0), - TP_identifier = character(0), - max_occurrence = numeric(0), - source = character(0), - pages = character(0), - stringsAsFactors = FALSE), + TP_identifier = character(0), + max_occurrence = numeric(0), + source = character(0), + page = character(0), + stringsAsFactors = FALSE), #' Add a line in the internal dataframe holding observed transformations + #' @param study_type A characterisation of the study type + #' @param TP_identifier An identifier of one of the transformation products + #' in `self$TPs` + #' @param max_occurrence The maximum observed occurrence of the + #' transformation product, expressed as a fraction of the amount that would + #' result from stochiometric transformation + #' @param source An acronym specifying the source of the information + #' @param pages The page from which the information was taken + #' @param remark A remark add_transformation = function(study_type, TP_identifier, max_occurrence, remark = "", source = NA, pages = NA) { @@ -344,19 +368,40 @@ chent <- R6Class("chent", if (is.numeric(pages)) pages <- paste(pages, collapse = ", ") cn <- colnames(self$transformations) self$transformations <- rbind(self$transformations, - data.frame(study_type = study_type, - TP_identifier = TP_identifier, - max_occurrence = max_occurrence, - remark = remark, - source = source, - pages = pages, - stringsAsFactors = FALSE)) + data.frame(study_type = study_type, + TP_identifier = TP_identifier, + max_occurrence = max_occurrence, + remark = remark, + source = source, + page = page, + stringsAsFactors = FALSE)) }, #' @field soil_degradation Dataframe of modelling DT50 values soil_degradation = NULL, #' Add a line in the internal dataframe holding modelling DT50 values + #' @param soils Names of the soils + #' @param DT50_mod The modelling DT50 in the sense of regulatory pesticide + #' fate modelling + #' @param DT50_mod_ref The normalised modelling DT50 in the sense of + #' regulatory pesticide fate modelling + #' @param type The soil type + #' @param country The country (mainly for field studies) + #' @param pH_orig The pH stated in the study + #' @param pH_medium The medium in which this pH was measured + #' @param pH_H2O The pH extrapolated to pure water + #' @param perc_OC The percentage of organic carbon in the soil + #' @param temperature The temperature during the study in degrees Celsius + #' @param moisture The moisture during the study + #' @param category Is it a laboratory ('lab') or field study ('field') + #' @param formulation Name of the formulation applied, if it was not + #' the technical active ingredient + #' @param model The degradation model used for deriving `DT50_mod` + #' @param chi2 The relative error as defined in FOCUS kinetics + #' @param source An acronym specifying the source of the information + #' @param page The page from which the information was taken + #' @param remark A remark add_soil_degradation = function(soils, DT50_mod, DT50_mod_ref, type = NA, country = NA, pH_orig = NA, pH_medium = NA, pH_H2O = NA, @@ -396,7 +441,13 @@ chent <- R6Class("chent", #' @field soil_ff Dataframe of formation fractions soil_ff = NULL, - add_soil_ff = function(target, soils, ff = 1, remark = "", source, page = NA) { + # Add one or more formation fractions for degradation in soil + #' @param target The identifier(s) of the transformation product + #' @param soils The soil name(s) in which the transformation was observed + #' @param ff The formation fraction(s) + add_soil_ff = function(target, soils, ff = 1, + remark = "", source, page = NA) + { new_soil_ff = data.frame( target = target, target = target, @@ -416,12 +467,19 @@ chent <- R6Class("chent", #' @field soil_sorption Dataframe of soil sorption data soil_sorption = NULL, + #' Add soil sorption data + #' @param Kf The sorption constant in L/kg, either linear (then `N` is 1) + #' or according to Freundlich + #' @param Kfoc The constant from above, normalised to soil organic carbon + #' @param N The Freundlich exponent + #' @param perc_clay The percentage of clay in the soil + #' @param CEC The cation exchange capacity add_soil_sorption = function(soils, Kf, Kfoc, N, - type = NA, - pH_orig = NA, pH_medium = NA, - pH_H2O = NA, - perc_OC = NA, perc_clay = NA, CEC = NA, - remark = "", source, page = NA) { + type = NA, pH_orig = NA, pH_medium = NA, + pH_H2O = NA, + perc_OC = NA, perc_clay = NA, CEC = NA, + remark = "", source, page = NA) + { new_soil_sorption = data.frame( soils = soils, Kf = Kf, Kfoc = Kfoc, N = N, @@ -441,6 +499,10 @@ chent <- R6Class("chent", } }, + #' Write a PDF image of the structure + #' @param file The file to write to + #' @param dir The directory to write the file to + #' @param template A template expressed as SMILES to use in RDKit pdf = function(file = paste0(self$identifier, ".pdf"), dir = "structures/pdf", template = NULL) { if (!dir.exists(dir)) { @@ -462,8 +524,12 @@ chent <- R6Class("chent", m_line <- suppressWarnings(grep("MediaBox", head, value = TRUE)) self$pdf_height <- as.numeric(gsub("/MediaBox \\[.* (.*)\\]", "\\1", m_line)) }, - png = function(file = paste0(self$identifier, ".png"), dir = "structures/png", - antialias = 'gray') { + + #' Write a PNG image of the structure + #' @param antialias Passed to [png][grDevices::png] + png = function(file = paste0(self$identifier, ".png"), + dir = "structures/png", antialias = 'gray') + { if (!dir.exists(dir)) { message("Directory '", dir, "' does not exist") message("Trying to create directory '", dir, "'") @@ -475,7 +541,12 @@ chent <- R6Class("chent", plot(self) dev.off() }, - emf = function(file = paste0(self$identifier, ".emf"), dir = "structures/emf") { + + #' Write an EMF image of the structure using [emf][devEMF::emf] + #' @param file The file to write to + emf = function(file = paste0(self$identifier, ".emf"), + dir = "structures/emf") + { if (!requireNamespace("devEMF")) { stop("You need to have the devEMF package installed for this function") } @@ -521,8 +592,8 @@ print.chent = function(x, ...) { #' @param subdir The path to which the file should be written #' @export draw_svg.chent = function(x, width = 300, height = 150, - filename = paste0(names(x$identifier), ".svg"), - subdir = "svg") { + filename = paste0(names(x$identifier), ".svg"), + subdir = "svg") { if (!rdkit_available) { stop("RDkit is not available via reticulate") } else { @@ -560,8 +631,6 @@ plot.chent = function(x, ...) { #' @importFrom R6 R6Class #' @export #' @format An \code{\link{R6Class}} generator object -#' @field iso ISO common name according to ISO 1750 as retreived from pesticidecompendium.bcpc.org -#' @field bcpc List of information retrieved from pesticidecompendium.bcpc.org #' @examples #' # On Travis, we get a certificate validation error, #' # likely because the system (xenial) is so old, @@ -575,18 +644,35 @@ plot.chent = function(x, ...) { #' } #' #' } + pai <- R6Class("pai", inherit = chent, - public <- list( + public = list( + + #' @field iso ISO common name of the active ingredient according to ISO 1750 iso = NULL, + + #' @field bcpc Information retrieved from the BCPC compendium available online + #' at bcpc = NULL, + + #' Creates a new instance of this [R6][R6::R6Class] class. + #' + #' @description This class is derived from [chent]. It makes it easy + #' to create a [chent] from the ISO common name of a pesticide active + #' ingredient, and additionally stores the ISO name as well as + #' the complete result of querying the BCPC compendium using + #' [bcpc_query][webchem::bcpc_query]. + #' + #' @param iso The ISO common name to be used in the query of the + #' BCPC compendium + #' + #' @param identifier Alternative identifier used for querying pubchem initialize = function(iso, identifier = iso, - smiles = NULL, - inchikey = NULL, - bcpc = TRUE, - pubchem = TRUE, pubchem_from = 'auto', - rdkit = TRUE, template = NULL, - chyaml = TRUE) + smiles = NULL, inchikey = NULL, bcpc = TRUE, + pubchem = TRUE, pubchem_from = 'auto', + rdkit = TRUE, template = NULL, + chyaml = TRUE) { if (!is.null(inchikey)) { @@ -631,10 +717,9 @@ pai <- R6Class("pai", } super$initialize(identifier = identifier, - smiles = smiles, - inchikey = self$inchikey, - pubchem = pubchem, pubchem_from = pubchem_from, - rdkit = rdkit, template = template, chyaml = chyaml) + smiles = smiles, inchikey = self$inchikey, + pubchem = pubchem, pubchem_from = pubchem_from, + rdkit = rdkit, template = template, chyaml = chyaml) invisible(self) } @@ -659,30 +744,47 @@ print.pai = function(x, ...) { } } -#' R6 class for holding a product with at least one active ingredient +#' @title R6 class for a plant protection product with at least one active ingredient #' -#' An R6 class for holding information about a product with at least one active ingredient +#' @description Contains basic information about the active ingredients in the +#' product #' #' @docType class #' @importFrom R6 R6Class #' @export #' @format An \code{\link{R6Class}} generator object. -#' @field name The name of the product -#' @field ais A list of active ingredients -#' @field concentrations The concentration of the ais -#' @field concentration_units Defaults to g/L -#' @keywords data - -pp <- R6Class("pp", - public <- list( + +ppp <- R6Class("ppp", + public = list( + + #' @field name The name of the product name = NULL, + + #' @field ais A list of active ingredients ais = list(), + + #' @field concentrations The concentration of the ais concentrations = NULL, + + #' @field concentration_units Defaults to g/L concentration_units = NULL, + + #' @field density The density of the product density = NULL, + + #' @field density_units Defaults to g/L density_units = "g/L", + + #' Creates a new instance of this [R6][R6::R6Class] class. + #' + #' @field ... Identifiers of the active ingredients + #' @field concentrations Concentrations of the active ingredients + #' @field concentration_units Defaults to g/L + #' @field density The density + #' @field density_units Defaults to g/L initialize = function(name, ..., concentrations, concentration_units = "g/L", - density = 1000, density_units = "g/L") { + density = 1000, density_units = "g/L") + { self$name <- name self$ais <- list(...) self$concentrations <- concentrations @@ -691,6 +793,8 @@ pp <- R6Class("pp", names(self$concentrations) <- names(self$ais) self$concentration_units <- concentration_units }, + + #' Printing method print = function() { cat(" named", self$name, "\n") } diff --git a/_pkgdown.yml b/_pkgdown.yml index 2d8ddc3..f099651 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -12,4 +12,4 @@ reference: - print.chent - pai - print.pai - - pp + - ppp diff --git a/docs/404.html b/docs/404.html index eb79a5d..26a509c 100644 --- a/docs/404.html +++ b/docs/404.html @@ -32,7 +32,7 @@ chents - 0.3.1 + 0.3.2 diff --git a/docs/authors.html b/docs/authors.html index 0c3b654..1e764a7 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -17,7 +17,7 @@ chents - 0.3.1 + 0.3.2 @@ -60,13 +60,13 @@

Ranke J (2023). chents: Chemical Entities as R Objects. -R package version 0.3.1, https://github.com/jranke/chents. +R package version 0.3.2, https://github.com/jranke/chents.

@Manual{,
   title = {chents: Chemical Entities as R Objects},
   author = {Johannes Ranke},
   year = {2023},
-  note = {R package version 0.3.1},
+  note = {R package version 0.3.2},
   url = {https://github.com/jranke/chents},
 }
diff --git a/docs/index.html b/docs/index.html index f241bb6..313ff06 100644 --- a/docs/index.html +++ b/docs/index.html @@ -37,7 +37,7 @@ chents - 0.3.1 + 0.3.2 diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index dd7c4f0..eb77ea1 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -2,5 +2,5 @@ pandoc: 3.1.1 pkgdown: 2.0.7 pkgdown_sha: ~ articles: {} -last_built: 2023-11-10T17:41Z +last_built: 2023-11-11T07:23Z diff --git a/docs/reference/chent.html b/docs/reference/chent.html index a6b8dde..48ccf3f 100644 --- a/docs/reference/chent.html +++ b/docs/reference/chent.html @@ -19,7 +19,7 @@ generated using RDKit if RDKit and its python bindings are installed.">An R6 class for pesticidal active ingredients and associated data — pai • chentsAn R6 class for pesticidal active ingredients and associated data — pai • chents @@ -18,7 +18,7 @@ Additional chemical information is retrieved from the internet if available."> chents - 0.3.1 + 0.3.2 @@ -47,14 +47,19 @@ Additional chemical information is retrieved from the internet if available.">
-

The class is initialised with an identifier which is generally an ISO common name. -Additional chemical information is retrieved from the internet if available.

+

An R6 class for pesticidal active ingredients and associated data

+

An R6 class for pesticidal active ingredients and associated data

Format

An R6Class generator object

+
+
+

Details

+

The class is initialised with an identifier which is generally an ISO common name. +Additional chemical information is retrieved from the internet if available.

Super class

@@ -63,11 +68,13 @@ Additional chemical information is retrieved from the internet if available.

Public fields

iso
-

ISO common name according to ISO 1750 as retreived from pesticidecompendium.bcpc.org

+

ISO common name of the active ingredient according to ISO 1750

bcpc
-

List of information retrieved from pesticidecompendium.bcpc.org

+

Information retrieved from the BCPC compendium available online +at <pesticidecompendium.bcpc.org> +Creates a new instance of this R6 class.

@@ -97,8 +104,11 @@ Additional chemical information is retrieved from the internet if available.

  • chents::chent$try_pubchem()

  • Method new()

    - -
    +

    This class is derived from chent. It makes it easy +to create a chent from the ISO common name of a pesticide active +ingredient, and additionally stores the ISO name as well as +the complete result of querying the BCPC compendium using +bcpc_query.

    Usage

    pai$new(
       iso,
    @@ -114,6 +124,19 @@ Additional chemical information is retrieved from the internet if available.

    )

    +
    +

    Arguments

    +

    iso
    +

    The ISO common name to be used in the query of the +BCPC compendium

    + + +
    identifier
    +

    Alternative identifier used for querying pubchem

    + + +

    +


    Method clone()

    @@ -123,7 +146,7 @@ Additional chemical information is retrieved from the internet if available.

    -

    Arguments

    +

    Arguments

    deep

    Whether to make a deep clone.

    diff --git a/docs/reference/plot.chent.html b/docs/reference/plot.chent.html index 470ce79..26d8445 100644 --- a/docs/reference/plot.chent.html +++ b/docs/reference/plot.chent.html @@ -17,7 +17,7 @@ chents - 0.3.1 + 0.3.2
    diff --git a/docs/reference/ppp.html b/docs/reference/ppp.html new file mode 100644 index 0000000..7a9b861 --- /dev/null +++ b/docs/reference/ppp.html @@ -0,0 +1,194 @@ + +R6 class for a plant protection product with at least one active ingredient — ppp • chents + + +
    +
    + + + +
    +
    + + +
    +

    Contains basic information about the active ingredients in the +product

    +
    + + +
    +

    Format

    +

    An R6Class generator object.

    +
    +
    +

    Public fields

    +

    name
    +

    The name of the product

    + + +
    ais
    +

    A list of active ingredients

    + + +
    concentrations
    +

    The concentration of the ais

    + + +
    concentration_units
    +

    Defaults to g/L

    + + +
    density
    +

    The density of the product

    + + +
    density_units
    +

    Defaults to g/L +Creates a new instance of this R6 class.

    + + +
    ...
    +

    Identifiers of the active ingredients

    + + +
    concentrations
    +

    Concentrations of the active ingredients

    + + +
    concentration_units
    +

    Defaults to g/L

    + + +
    density
    +

    The density

    + + +
    density_units
    +

    Defaults to g/L +Printing method

    + + +

    +
    +
    +

    Active bindings

    +

    ...
    +

    Identifiers of the active ingredients

    + + +

    +
    +
    +

    Methods

    + +
    +

    Public methods

    + +


    +

    Method new()

    + +
    +

    Usage

    +

    ppp$new(
    +  name,
    +  ...,
    +  concentrations,
    +  concentration_units = "g/L",
    +  density = 1000,
    +  density_units = "g/L"
    +)

    +
    + + +


    +

    Method print()

    + +
    +

    Usage

    +

    ppp$print()

    +
    + + +


    +

    Method clone()

    +

    The objects of this class are cloneable with this method.

    +

    Usage

    +

    ppp$clone(deep = FALSE)

    +
    + +
    +

    Arguments

    +

    deep
    +

    Whether to make a deep clone.

    + + +

    +
    + +
    + +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/print.chent.html b/docs/reference/print.chent.html index 08497dd..da3ba4f 100644 --- a/docs/reference/print.chent.html +++ b/docs/reference/print.chent.html @@ -17,7 +17,7 @@ chents - 0.3.1 + 0.3.2
    diff --git a/docs/reference/print.pai.html b/docs/reference/print.pai.html index 3faa5f7..5a08066 100644 --- a/docs/reference/print.pai.html +++ b/docs/reference/print.pai.html @@ -17,7 +17,7 @@ chents - 0.3.1 + 0.3.2
    diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 986ccf3..63ab18d 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -27,6 +27,9 @@ /reference/pp.html + + /reference/ppp.html + /reference/print.chent.html diff --git a/man/chent.Rd b/man/chent.Rd index e069938..686d6c7 100644 --- a/man/chent.Rd +++ b/man/chent.Rd @@ -73,7 +73,8 @@ Add a line in the internal dataframe holding modelling DT50 values} \item{\code{soil_ff}}{Dataframe of formation fractions} -\item{\code{soil_sorption}}{Dataframe of soil sorption data} +\item{\code{soil_sorption}}{Dataframe of soil sorption data +Add soil sorption data} } \if{html}{\out{
    }} } @@ -214,7 +215,9 @@ Obtain information from a YAML file} \describe{ \item{\code{repo}}{Should the file be looked for in the current working directory, a local git repository under \verb{~/git/chyaml}, or from -the web (not implemented). +the web (not implemented).} + +\item{\code{chyaml}}{The filename to be looked for Add a vapour pressure} } \if{html}{\out{
    }} @@ -256,7 +259,17 @@ Add a water solubility} \subsection{Arguments}{ \if{html}{\out{
    }} \describe{ -\item{\code{p0}}{The water solubility in mg/L +\item{\code{cwsat}}{The water solubility in mg/L} + +\item{\code{T}}{Temperature} + +\item{\code{pH}}{The pH value} + +\item{\code{source}}{An acronym specifying the source of the information} + +\item{\code{page}}{The page from which the information was taken} + +\item{\code{remark}}{A remark Add a plant uptake factor} } \if{html}{\out{
    }} @@ -279,6 +292,12 @@ Add a plant uptake factor} \if{html}{\out{
    }} \describe{ \item{\code{PUF}}{The plant uptake factor, a number between 0 and 1} + +\item{\code{source}}{An acronym specifying the source of the information} + +\item{\code{page}}{The page from which the information was taken} + +\item{\code{remark}}{A remark} } \if{html}{\out{
    }} } @@ -318,6 +337,26 @@ Add a plant uptake factor} )}\if{html}{\out{}} } +\subsection{Arguments}{ +\if{html}{\out{
    }} +\describe{ +\item{\code{study_type}}{A characterisation of the study type} + +\item{\code{TP_identifier}}{An identifier of one of the transformation products +in \code{self$TPs}} + +\item{\code{max_occurrence}}{The maximum observed occurrence of the +transformation product, expressed as a fraction of the amount that would +result from stochiometric transformation} + +\item{\code{remark}}{A remark} + +\item{\code{source}}{An acronym specifying the source of the information} + +\item{\code{pages}}{The page from which the information was taken} +} +\if{html}{\out{
    }} +} } \if{html}{\out{
    }} \if{html}{\out{}} @@ -346,6 +385,50 @@ Add a plant uptake factor} )}\if{html}{\out{}} } +\subsection{Arguments}{ +\if{html}{\out{
    }} +\describe{ +\item{\code{soils}}{Names of the soils} + +\item{\code{DT50_mod}}{The modelling DT50 in the sense of regulatory pesticide +fate modelling} + +\item{\code{DT50_mod_ref}}{The normalised modelling DT50 in the sense of +regulatory pesticide fate modelling} + +\item{\code{type}}{The soil type} + +\item{\code{country}}{The country (mainly for field studies)} + +\item{\code{pH_orig}}{The pH stated in the study} + +\item{\code{pH_medium}}{The medium in which this pH was measured} + +\item{\code{pH_H2O}}{The pH extrapolated to pure water} + +\item{\code{perc_OC}}{The percentage of organic carbon in the soil} + +\item{\code{temperature}}{The temperature during the study in degrees Celsius} + +\item{\code{moisture}}{The moisture during the study} + +\item{\code{category}}{Is it a laboratory ('lab') or field study ('field')} + +\item{\code{formulation}}{Name of the formulation applied, if it was not +the technical active ingredient} + +\item{\code{model}}{The degradation model used for deriving \code{DT50_mod}} + +\item{\code{chi2}}{The relative error as defined in FOCUS kinetics} + +\item{\code{remark}}{A remark} + +\item{\code{source}}{An acronym specifying the source of the information} + +\item{\code{page}}{The page from which the information was taken} +} +\if{html}{\out{
    }} +} } \if{html}{\out{
    }} \if{html}{\out{}} @@ -355,6 +438,17 @@ Add a plant uptake factor} \if{html}{\out{
    }}\preformatted{chent$add_soil_ff(target, soils, ff = 1, remark = "", source, page = NA)}\if{html}{\out{
    }} } +\subsection{Arguments}{ +\if{html}{\out{
    }} +\describe{ +\item{\code{target}}{The identifier(s) of the transformation product} + +\item{\code{soils}}{The soil name(s) in which the transformation was observed} + +\item{\code{ff}}{The formation fraction(s)} +} +\if{html}{\out{
    }} +} } \if{html}{\out{
    }} \if{html}{\out{}} @@ -379,6 +473,23 @@ Add a plant uptake factor} )}\if{html}{\out{}} } +\subsection{Arguments}{ +\if{html}{\out{
    }} +\describe{ +\item{\code{Kf}}{The sorption constant in L/kg, either linear (then \code{N} is 1) +or according to Freundlich} + +\item{\code{Kfoc}}{The constant from above, normalised to soil organic carbon} + +\item{\code{N}}{The Freundlich exponent} + +\item{\code{perc_clay}}{The percentage of clay in the soil} + +\item{\code{CEC}}{The cation exchange capacity +Write a PDF image of the structure} +} +\if{html}{\out{
    }} +} } \if{html}{\out{
    }} \if{html}{\out{}} @@ -392,6 +503,18 @@ Add a plant uptake factor} )}\if{html}{\out{}} } +\subsection{Arguments}{ +\if{html}{\out{
    }} +\describe{ +\item{\code{file}}{The file to write to} + +\item{\code{dir}}{The directory to write the file to} + +\item{\code{template}}{A template expressed as SMILES to use in RDKit +Write a PNG image of the structure} +} +\if{html}{\out{
    }} +} } \if{html}{\out{
    }} \if{html}{\out{}} @@ -405,6 +528,14 @@ Add a plant uptake factor} )}\if{html}{\out{}} } +\subsection{Arguments}{ +\if{html}{\out{
    }} +\describe{ +\item{\code{antialias}}{Passed to \link[grDevices:png]{png} +Write an EMF image of the structure using \link[devEMF:emf]{emf}} +} +\if{html}{\out{
    }} +} } \if{html}{\out{
    }} \if{html}{\out{}} @@ -414,6 +545,13 @@ Add a plant uptake factor} \if{html}{\out{
    }}\preformatted{chent$emf(file = paste0(self$identifier, ".emf"), dir = "structures/emf")}\if{html}{\out{
    }} } +\subsection{Arguments}{ +\if{html}{\out{
    }} +\describe{ +\item{\code{file}}{The file to write to} +} +\if{html}{\out{
    }} +} } \if{html}{\out{
    }} \if{html}{\out{}} diff --git a/man/pai.Rd b/man/pai.Rd index d966a9e..f133c5a 100644 --- a/man/pai.Rd +++ b/man/pai.Rd @@ -8,6 +8,11 @@ An \code{\link{R6Class}} generator object } \description{ +An R6 class for pesticidal active ingredients and associated data + +An R6 class for pesticidal active ingredients and associated data +} +\details{ The class is initialised with an identifier which is generally an ISO common name. Additional chemical information is retrieved from the internet if available. } @@ -31,9 +36,11 @@ if (!is.null(atr$Picture)) { \section{Public fields}{ \if{html}{\out{
    }} \describe{ -\item{\code{iso}}{ISO common name according to ISO 1750 as retreived from pesticidecompendium.bcpc.org} +\item{\code{iso}}{ISO common name of the active ingredient according to ISO 1750} -\item{\code{bcpc}}{List of information retrieved from pesticidecompendium.bcpc.org} +\item{\code{bcpc}}{Information retrieved from the BCPC compendium available online +at +Creates a new instance of this \link[R6:R6Class]{R6} class.} } \if{html}{\out{
    }} } @@ -69,6 +76,11 @@ if (!is.null(atr$Picture)) { \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-pai-new}{}}} \subsection{Method \code{new()}}{ +This class is derived from \link{chent}. It makes it easy +to create a \link{chent} from the ISO common name of a pesticide active +ingredient, and additionally stores the ISO name as well as +the complete result of querying the BCPC compendium using +\link[webchem:bcpc_query]{bcpc_query}. \subsection{Usage}{ \if{html}{\out{
    }}\preformatted{pai$new( iso, @@ -84,6 +96,16 @@ if (!is.null(atr$Picture)) { )}\if{html}{\out{
    }} } +\subsection{Arguments}{ +\if{html}{\out{
    }} +\describe{ +\item{\code{iso}}{The ISO common name to be used in the query of the +BCPC compendium} + +\item{\code{identifier}}{Alternative identifier used for querying pubchem} +} +\if{html}{\out{
    }} +} } \if{html}{\out{
    }} \if{html}{\out{}} diff --git a/man/pp.Rd b/man/pp.Rd deleted file mode 100644 index 363f9ba..0000000 --- a/man/pp.Rd +++ /dev/null @@ -1,77 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/chent.R -\docType{class} -\name{pp} -\alias{pp} -\title{R6 class for holding a product with at least one active ingredient} -\format{ -An \code{\link{R6Class}} generator object. -} -\description{ -An R6 class for holding information about a product with at least one active ingredient -} -\keyword{data} -\section{Public fields}{ -\if{html}{\out{
    }} -\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} -} -\if{html}{\out{
    }} -} -\section{Methods}{ -\subsection{Public methods}{ -\itemize{ -\item \href{#method-pp-new}{\code{pp$new()}} -\item \href{#method-pp-print}{\code{pp$print()}} -\item \href{#method-pp-clone}{\code{pp$clone()}} -} -} -\if{html}{\out{
    }} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-pp-new}{}}} -\subsection{Method \code{new()}}{ -\subsection{Usage}{ -\if{html}{\out{
    }}\preformatted{pp$new( - name, - ..., - concentrations, - concentration_units = "g/L", - density = 1000, - density_units = "g/L" -)}\if{html}{\out{
    }} -} - -} -\if{html}{\out{
    }} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-pp-print}{}}} -\subsection{Method \code{print()}}{ -\subsection{Usage}{ -\if{html}{\out{
    }}\preformatted{pp$print()}\if{html}{\out{
    }} -} - -} -\if{html}{\out{
    }} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-pp-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
    }}\preformatted{pp$clone(deep = FALSE)}\if{html}{\out{
    }} -} - -\subsection{Arguments}{ -\if{html}{\out{
    }} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
    }} -} -} -} diff --git a/man/ppp.Rd b/man/ppp.Rd new file mode 100644 index 0000000..c0d35f1 --- /dev/null +++ b/man/ppp.Rd @@ -0,0 +1,100 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/chent.R +\docType{class} +\name{ppp} +\alias{ppp} +\title{R6 class for a plant protection product with at least one active ingredient} +\format{ +An \code{\link{R6Class}} generator object. +} +\description{ +Contains basic information about the active ingredients in the +product +} +\section{Public fields}{ +\if{html}{\out{
    }} +\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} + +\item{\code{density}}{The density of the product} + +\item{\code{density_units}}{Defaults to g/L +Creates a new instance of this \link[R6:R6Class]{R6} class.} + +\item{\code{...}}{Identifiers of the active ingredients} + +\item{\code{concentrations}}{Concentrations of the active ingredients} + +\item{\code{concentration_units}}{Defaults to g/L} + +\item{\code{density}}{The density} + +\item{\code{density_units}}{Defaults to g/L +Printing method} +} +\if{html}{\out{
    }} +} +\section{Active bindings}{ +\if{html}{\out{
    }} +\describe{ +\item{\code{...}}{Identifiers of the active ingredients} +} +\if{html}{\out{
    }} +} +\section{Methods}{ +\subsection{Public methods}{ +\itemize{ +\item \href{#method-ppp-new}{\code{ppp$new()}} +\item \href{#method-ppp-print}{\code{ppp$print()}} +\item \href{#method-ppp-clone}{\code{ppp$clone()}} +} +} +\if{html}{\out{
    }} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ppp-new}{}}} +\subsection{Method \code{new()}}{ +\subsection{Usage}{ +\if{html}{\out{
    }}\preformatted{ppp$new( + name, + ..., + concentrations, + concentration_units = "g/L", + density = 1000, + density_units = "g/L" +)}\if{html}{\out{
    }} +} + +} +\if{html}{\out{
    }} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ppp-print}{}}} +\subsection{Method \code{print()}}{ +\subsection{Usage}{ +\if{html}{\out{
    }}\preformatted{ppp$print()}\if{html}{\out{
    }} +} + +} +\if{html}{\out{
    }} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ppp-clone}{}}} +\subsection{Method \code{clone()}}{ +The objects of this class are cloneable with this method. +\subsection{Usage}{ +\if{html}{\out{
    }}\preformatted{ppp$clone(deep = FALSE)}\if{html}{\out{
    }} +} + +\subsection{Arguments}{ +\if{html}{\out{
    }} +\describe{ +\item{\code{deep}}{Whether to make a deep clone.} +} +\if{html}{\out{
    }} +} +} +} -- cgit v1.2.1