aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2020-10-13 11:26:03 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2020-10-13 11:26:03 +0200
commit6937e41d317b953d8246203814500166dbe89470 (patch)
treebc996f7c454c3780368adc989fd562eae30fc591
parentc8bfe56bd627e1945815631ce5c2ac27333fa246 (diff)
Temporarily remove @example tags
Due to r-lib/roxygen2#1158
-rw-r--r--ChangeLog6
-rw-r--r--DESCRIPTION6
-rw-r--r--GNUmakefile4
-rw-r--r--R/chent.R12
-rw-r--r--man/chent.Rd273
-rw-r--r--man/draw_svg.chent.Rd9
-rw-r--r--man/pai.Rd87
-rw-r--r--man/plot.chent.Rd7
-rw-r--r--man/pp.Rd65
-rw-r--r--tests/testthat/test_chent.R4
10 files changed, 415 insertions, 58 deletions
diff --git a/ChangeLog b/ChangeLog
index 2c43ec8..77934da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+commit c8bfe56bd627e1945815631ce5c2ac27333fa246
+Author: Johannes Ranke <jranke@uni-bremen.de>
+Date: 2019-07-15 14:45:52 +0200
+
+ Add chent$emf() function based on devEMF
+
commit 1cc812d69311a1b3f846d0fb160a68a26fe11d65
Author: Johannes Ranke <jranke@uni-bremen.de>
Date: 2019-03-20 15:58:34 +0100
diff --git a/DESCRIPTION b/DESCRIPTION
index a94f482..f19c36b 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,8 +1,8 @@
Package: chents
Type: Package
Title: Chemical Entities as R Objects
-Version: 0.2-8
-Date: 2019-07-13
+Version: 0.2-9
+Date: 2020-10-13
Authors@R: c(person("Johannes", "Ranke", role = c("aut", "cre", "cph"),
email = "jranke@uni-bremen.de"))
Description: Utilities for dealing with chemical entities and associated
@@ -29,4 +29,4 @@ LazyData: yes
Encoding: UTF-8
VignetteBuilder: knitr
URL: https://github.com/jranke/chents
-RoxygenNote: 6.1.1
+RoxygenNote: 7.1.1.9000
diff --git a/GNUmakefile b/GNUmakefile
index b049fac..fdf9b80 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -54,12 +54,12 @@ test: build
quickcheck: build
@echo "Running check..."
- "$(R_HOME)/bin/R" CMD check $(TGZ) --no-tests
+ _R_CHECK_CRAN_INCOMING_REMOTE_=false "$(R_HOME)/bin/R" CMD check $(TGZ) --no-tests
@echo "DONE."
check: build
@echo "Running CRAN check..."
- "$(R_HOME)/bin/R" CMD check --as-cran $(TGZ)
+ _R_CHECK_CRAN_INCOMING_REMOTE_=false "$(R_HOME)/bin/R" CMD check --as-cran $(TGZ)
@echo "DONE."
install: build
diff --git a/R/chent.R b/R/chent.R
index f3626de..75b6098 100644
--- a/R/chent.R
+++ b/R/chent.R
@@ -21,7 +21,6 @@
#' the internet. Additionally, it can be generated using RDKit if RDKit and its
#' python bindings are installed and configured for use with PythonInR.
#'
-#' @docType class
#' @export
#' @format An \code{\link{R6Class}} generator object
#' @importFrom R6 R6Class
@@ -47,8 +46,6 @@
#' @field soil_ff Dataframe of formation fractions
#' @field soil_sorption Dataframe of soil sorption data
#' @field PUF Plant uptake factor
-#' @example inst/examples/octanol.R
-#' @example inst/examples/caffeine.R
#' @keywords data
chent <- R6Class("chent",
@@ -122,7 +119,7 @@ chent <- R6Class("chent",
if (n_results > 1) {
warning("Found ", n_results, " entries in PubChem, using the first one.")
}
- self$get_pubchem(pubchem_result[[1]][1])
+ self$get_pubchem(pubchem_result[[1, "cid"]])
}
},
get_pubchem = function(pubchem_cid) {
@@ -296,7 +293,7 @@ chent <- R6Class("chent",
stringsAsFactors = FALSE))
},
soil_degradation = NULL,
- add_soil_degradation = function(soils, DT50,
+ add_soil_degradation = function(soils, DT50_mod, DT50_mod_ref,
type = NA, country = NA,
pH_orig = NA, pH_medium = NA, pH_H2O = NA,
perc_OC = NA,
@@ -306,7 +303,8 @@ chent <- R6Class("chent",
remark = "", source, page = NA) {
new_soil_degradation = data.frame(
soil = soils,
- DT50 = DT50,
+ DT50_mod = DT50_mod,
+ DT50_mod_ref = DT50_mod_ref,
type = type,
country = country,
pH_orig = pH_orig,
@@ -473,7 +471,6 @@ draw_svg.chent = function(x, width = 300, height = 150,
#' @importFrom grImport grid.picture
#' @param x The chent object to be plotted
#' @param ... Further arguments passed to \code{\link{grid.picture}}
-#' @example inst/examples/caffeine.R
#' @export
plot.chent = function(x, ...) {
if (is.null(x$Picture)) stop("No Picture object in chent, was RDKit available during creation?")
@@ -491,7 +488,6 @@ plot.chent = function(x, ...) {
#' @format An \code{\link{R6Class}} generator object
#' @field iso ISO common name according to ISO 1750 as retreived from www.alanwood.net/pesticides
#' @field alanwood List of information retreived from www.alanwood.net/pesticides
-#' @example inst/examples/pai.R
#' @keywords data
pai <- R6Class("pai",
diff --git a/man/chent.Rd b/man/chent.Rd
index 29fba70..a1a5fe8 100644
--- a/man/chent.Rd
+++ b/man/chent.Rd
@@ -1,20 +1,19 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/chent.R
-\docType{class}
\name{chent}
\alias{chent}
\title{An R6 class for chemical entities with associated data}
-\format{An \code{\link{R6Class}} generator object}
-\usage{
-chent
+\format{
+An \code{\link{R6Class}} generator object
}
\description{
The class is initialised with an identifier. Chemical information is retrieved from
the internet. Additionally, it can be generated using RDKit if RDKit and its
python bindings are installed and configured for use with PythonInR.
}
-\section{Fields}{
-
+\keyword{data}
+\section{Public fields}{
+\if{html}{\out{<div class="r6-fields">}}
\describe{
\item{\code{identifier}}{The identifier that was used to initiate the object, with attribute 'source'}
@@ -50,18 +49,258 @@ configured for use with PythonInR}
\item{\code{soil_sorption}}{Dataframe of soil sorption data}
\item{\code{PUF}}{Plant uptake factor}
-}}
+}
+\if{html}{\out{</div>}}
+}
+\section{Methods}{
+\subsection{Public methods}{
+\itemize{
+\item \href{#method-new}{\code{chent$new()}}
+\item \href{#method-try_pubchem}{\code{chent$try_pubchem()}}
+\item \href{#method-get_pubchem}{\code{chent$get_pubchem()}}
+\item \href{#method-get_rdkit}{\code{chent$get_rdkit()}}
+\item \href{#method-get_chyaml}{\code{chent$get_chyaml()}}
+\item \href{#method-add_p0}{\code{chent$add_p0()}}
+\item \href{#method-add_cwsat}{\code{chent$add_cwsat()}}
+\item \href{#method-add_PUF}{\code{chent$add_PUF()}}
+\item \href{#method-add_TP}{\code{chent$add_TP()}}
+\item \href{#method-add_transformation}{\code{chent$add_transformation()}}
+\item \href{#method-add_soil_degradation}{\code{chent$add_soil_degradation()}}
+\item \href{#method-add_soil_ff}{\code{chent$add_soil_ff()}}
+\item \href{#method-add_soil_sorption}{\code{chent$add_soil_sorption()}}
+\item \href{#method-pdf}{\code{chent$pdf()}}
+\item \href{#method-png}{\code{chent$png()}}
+\item \href{#method-emf}{\code{chent$emf()}}
+\item \href{#method-clone}{\code{chent$clone()}}
+}
+}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-new"></a>}}
+\if{latex}{\out{\hypertarget{method-new}{}}}
+\subsection{Method \code{new()}}{
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{chent$new(
+ identifier,
+ smiles = NULL,
+ smiles_source = "user",
+ inchikey = NULL,
+ inchikey_source = "user",
+ pubchem = TRUE,
+ pubchem_from = c("name", "smiles", "inchikey"),
+ rdkit = TRUE,
+ template = NULL,
+ chyaml = TRUE
+)}\if{html}{\out{</div>}}
+}
-\examples{
-oct <- chent$new("1-octanol", smiles = "CCCCCCCCO")
-print(oct)
-if (!is.null(oct$Picture)) {
- plot(oct)
}
-caffeine <- chent$new("caffeine")
-print(caffeine)
-if (!is.null(caffeine$Picture)) {
- plot(caffeine)
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-try_pubchem"></a>}}
+\if{latex}{\out{\hypertarget{method-try_pubchem}{}}}
+\subsection{Method \code{try_pubchem()}}{
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{chent$try_pubchem(query, from = "name")}\if{html}{\out{</div>}}
+}
+
+}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-get_pubchem"></a>}}
+\if{latex}{\out{\hypertarget{method-get_pubchem}{}}}
+\subsection{Method \code{get_pubchem()}}{
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{chent$get_pubchem(pubchem_cid)}\if{html}{\out{</div>}}
+}
+
+}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-get_rdkit"></a>}}
+\if{latex}{\out{\hypertarget{method-get_rdkit}{}}}
+\subsection{Method \code{get_rdkit()}}{
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{chent$get_rdkit(template = NULL)}\if{html}{\out{</div>}}
+}
+
+}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-get_chyaml"></a>}}
+\if{latex}{\out{\hypertarget{method-get_chyaml}{}}}
+\subsection{Method \code{get_chyaml()}}{
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{chent$get_chyaml(
+ repo = c("wd", "local", "web"),
+ chyaml = paste0(URLencode(self$identifier), ".yaml")
+)}\if{html}{\out{</div>}}
+}
+
+}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-add_p0"></a>}}
+\if{latex}{\out{\hypertarget{method-add_p0}{}}}
+\subsection{Method \code{add_p0()}}{
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{chent$add_p0(p0, T = NA, source = NA, page = NA, remark = "")}\if{html}{\out{</div>}}
+}
+
+}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-add_cwsat"></a>}}
+\if{latex}{\out{\hypertarget{method-add_cwsat}{}}}
+\subsection{Method \code{add_cwsat()}}{
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{chent$add_cwsat(cwsat, T = NA, pH = NA, source = NA, page = NA, remark = "")}\if{html}{\out{</div>}}
+}
+
+}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-add_PUF"></a>}}
+\if{latex}{\out{\hypertarget{method-add_PUF}{}}}
+\subsection{Method \code{add_PUF()}}{
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{chent$add_PUF(
+ PUF = 0,
+ source = "focus_generic_gw_2014",
+ page = 41,
+ remark = "Conservative default value"
+)}\if{html}{\out{</div>}}
+}
+
+}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-add_TP"></a>}}
+\if{latex}{\out{\hypertarget{method-add_TP}{}}}
+\subsection{Method \code{add_TP()}}{
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{chent$add_TP(x, smiles = NULL, pubchem = FALSE)}\if{html}{\out{</div>}}
+}
+
+}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-add_transformation"></a>}}
+\if{latex}{\out{\hypertarget{method-add_transformation}{}}}
+\subsection{Method \code{add_transformation()}}{
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{chent$add_transformation(
+ study_type,
+ TP_identifier,
+ max_occurrence,
+ remark = "",
+ source = NA,
+ pages = NA
+)}\if{html}{\out{</div>}}
+}
+
+}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-add_soil_degradation"></a>}}
+\if{latex}{\out{\hypertarget{method-add_soil_degradation}{}}}
+\subsection{Method \code{add_soil_degradation()}}{
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{chent$add_soil_degradation(
+ soils,
+ DT50_mod,
+ DT50_mod_ref,
+ type = NA,
+ country = NA,
+ pH_orig = NA,
+ pH_medium = NA,
+ pH_H2O = NA,
+ perc_OC = NA,
+ temperature = NA,
+ moisture = NA,
+ category = "lab",
+ formulation = NA,
+ model = NA,
+ chi2 = NA,
+ remark = "",
+ source,
+ page = NA
+)}\if{html}{\out{</div>}}
+}
+
+}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-add_soil_ff"></a>}}
+\if{latex}{\out{\hypertarget{method-add_soil_ff}{}}}
+\subsection{Method \code{add_soil_ff()}}{
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{chent$add_soil_ff(target, soils, ff = 1, remark = "", source, page = NA)}\if{html}{\out{</div>}}
+}
+
+}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-add_soil_sorption"></a>}}
+\if{latex}{\out{\hypertarget{method-add_soil_sorption}{}}}
+\subsection{Method \code{add_soil_sorption()}}{
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{chent$add_soil_sorption(
+ 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
+)}\if{html}{\out{</div>}}
+}
+
+}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-pdf"></a>}}
+\if{latex}{\out{\hypertarget{method-pdf}{}}}
+\subsection{Method \code{pdf()}}{
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{chent$pdf(
+ file = paste0(self$identifier, ".pdf"),
+ dir = "structures/pdf",
+ template = NULL
+)}\if{html}{\out{</div>}}
+}
+
+}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-png"></a>}}
+\if{latex}{\out{\hypertarget{method-png}{}}}
+\subsection{Method \code{png()}}{
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{chent$png(
+ file = paste0(self$identifier, ".png"),
+ dir = "structures/png",
+ antialias = "gray"
+)}\if{html}{\out{</div>}}
+}
+
+}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-emf"></a>}}
+\if{latex}{\out{\hypertarget{method-emf}{}}}
+\subsection{Method \code{emf()}}{
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{chent$emf(file = paste0(self$identifier, ".emf"), dir = "structures/emf")}\if{html}{\out{</div>}}
+}
+
+}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-clone"></a>}}
+\if{latex}{\out{\hypertarget{method-clone}{}}}
+\subsection{Method \code{clone()}}{
+The objects of this class are cloneable with this method.
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{chent$clone(deep = FALSE)}\if{html}{\out{</div>}}
+}
+
+\subsection{Arguments}{
+\if{html}{\out{<div class="arguments">}}
+\describe{
+\item{\code{deep}}{Whether to make a deep clone.}
+}
+\if{html}{\out{</div>}}
+}
}
}
-\keyword{data}
diff --git a/man/draw_svg.chent.Rd b/man/draw_svg.chent.Rd
index 93b657d..2125b47 100644
--- a/man/draw_svg.chent.Rd
+++ b/man/draw_svg.chent.Rd
@@ -4,8 +4,13 @@
\alias{draw_svg.chent}
\title{Draw SVG graph from a chent object using RDKit}
\usage{
-draw_svg.chent(x, width = 300, height = 150,
- filename = paste0(names(x$identifier), ".svg"), subdir = "svg")
+draw_svg.chent(
+ x,
+ width = 300,
+ height = 150,
+ filename = paste0(names(x$identifier), ".svg"),
+ subdir = "svg"
+)
}
\arguments{
\item{x}{The chent object to be plotted}
diff --git a/man/pai.Rd b/man/pai.Rd
index 96f21d0..6a243ab 100644
--- a/man/pai.Rd
+++ b/man/pai.Rd
@@ -4,24 +4,91 @@
\name{pai}
\alias{pai}
\title{An R6 class for pesticidal active ingredients and associated data}
-\format{An \code{\link{R6Class}} generator object}
-\usage{
-pai
+\format{
+An \code{\link{R6Class}} generator object
}
\description{
The class is initialised with an identifier which is generally an ISO common name.
Additional chemical information is retrieved from the internet if available.
}
-\section{Fields}{
-
+\keyword{data}
+\section{Super class}{
+\code{\link[chents:chent]{chents::chent}} -> \code{pai}
+}
+\section{Public fields}{
+\if{html}{\out{<div class="r6-fields">}}
\describe{
\item{\code{iso}}{ISO common name according to ISO 1750 as retreived from www.alanwood.net/pesticides}
\item{\code{alanwood}}{List of information retreived from www.alanwood.net/pesticides}
-}}
+}
+\if{html}{\out{</div>}}
+}
+\section{Methods}{
+\subsection{Public methods}{
+\itemize{
+\item \href{#method-new}{\code{pai$new()}}
+\item \href{#method-clone}{\code{pai$clone()}}
+}
+}
+\if{html}{
+\out{<details ><summary>Inherited methods</summary>}
+\itemize{
+\item \out{<span class="pkg-link" data-pkg="chents" data-topic="chent" data-id="add_PUF">}\href{../../chents/html/chent.html#method-add_PUF}{\code{chents::chent$add_PUF()}}\out{</span>}
+\item \out{<span class="pkg-link" data-pkg="chents" data-topic="chent" data-id="add_TP">}\href{../../chents/html/chent.html#method-add_TP}{\code{chents::chent$add_TP()}}\out{</span>}
+\item \out{<span class="pkg-link" data-pkg="chents" data-topic="chent" data-id="add_cwsat">}\href{../../chents/html/chent.html#method-add_cwsat}{\code{chents::chent$add_cwsat()}}\out{</span>}
+\item \out{<span class="pkg-link" data-pkg="chents" data-topic="chent" data-id="add_p0">}\href{../../chents/html/chent.html#method-add_p0}{\code{chents::chent$add_p0()}}\out{</span>}
+\item \out{<span class="pkg-link" data-pkg="chents" data-topic="chent" data-id="add_soil_degradation">}\href{../../chents/html/chent.html#method-add_soil_degradation}{\code{chents::chent$add_soil_degradation()}}\out{</span>}
+\item \out{<span class="pkg-link" data-pkg="chents" data-topic="chent" data-id="add_soil_ff">}\href{../../chents/html/chent.html#method-add_soil_ff}{\code{chents::chent$add_soil_ff()}}\out{</span>}
+\item \out{<span class="pkg-link" data-pkg="chents" data-topic="chent" data-id="add_soil_sorption">}\href{../../chents/html/chent.html#method-add_soil_sorption}{\code{chents::chent$add_soil_sorption()}}\out{</span>}
+\item \out{<span class="pkg-link" data-pkg="chents" data-topic="chent" data-id="add_transformation">}\href{../../chents/html/chent.html#method-add_transformation}{\code{chents::chent$add_transformation()}}\out{</span>}
+\item \out{<span class="pkg-link" data-pkg="chents" data-topic="chent" data-id="emf">}\href{../../chents/html/chent.html#method-emf}{\code{chents::chent$emf()}}\out{</span>}
+\item \out{<span class="pkg-link" data-pkg="chents" data-topic="chent" data-id="get_chyaml">}\href{../../chents/html/chent.html#method-get_chyaml}{\code{chents::chent$get_chyaml()}}\out{</span>}
+\item \out{<span class="pkg-link" data-pkg="chents" data-topic="chent" data-id="get_pubchem">}\href{../../chents/html/chent.html#method-get_pubchem}{\code{chents::chent$get_pubchem()}}\out{</span>}
+\item \out{<span class="pkg-link" data-pkg="chents" data-topic="chent" data-id="get_rdkit">}\href{../../chents/html/chent.html#method-get_rdkit}{\code{chents::chent$get_rdkit()}}\out{</span>}
+\item \out{<span class="pkg-link" data-pkg="chents" data-topic="chent" data-id="pdf">}\href{../../chents/html/chent.html#method-pdf}{\code{chents::chent$pdf()}}\out{</span>}
+\item \out{<span class="pkg-link" data-pkg="chents" data-topic="chent" data-id="png">}\href{../../chents/html/chent.html#method-png}{\code{chents::chent$png()}}\out{</span>}
+\item \out{<span class="pkg-link" data-pkg="chents" data-topic="chent" data-id="try_pubchem">}\href{../../chents/html/chent.html#method-try_pubchem}{\code{chents::chent$try_pubchem()}}\out{</span>}
+}
+\out{</details>}
+}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-new"></a>}}
+\if{latex}{\out{\hypertarget{method-new}{}}}
+\subsection{Method \code{new()}}{
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{pai$new(
+ iso,
+ identifier = iso,
+ smiles = NULL,
+ smiles_source = "user",
+ inchikey = NULL,
+ inchikey_source = "user",
+ alanwood = TRUE,
+ pubchem = TRUE,
+ pubchem_from = "auto",
+ rdkit = TRUE,
+ template = NULL,
+ chyaml = TRUE
+)}\if{html}{\out{</div>}}
+}
-\examples{
-atr <- pai$new("atrazine")
-print(atr)
}
-\keyword{data}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-clone"></a>}}
+\if{latex}{\out{\hypertarget{method-clone}{}}}
+\subsection{Method \code{clone()}}{
+The objects of this class are cloneable with this method.
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{pai$clone(deep = FALSE)}\if{html}{\out{</div>}}
+}
+
+\subsection{Arguments}{
+\if{html}{\out{<div class="arguments">}}
+\describe{
+\item{\code{deep}}{Whether to make a deep clone.}
+}
+\if{html}{\out{</div>}}
+}
+}
+}
diff --git a/man/plot.chent.Rd b/man/plot.chent.Rd
index f2850fa..e5a8770 100644
--- a/man/plot.chent.Rd
+++ b/man/plot.chent.Rd
@@ -14,10 +14,3 @@
\description{
Plot method for chent objects
}
-\examples{
-caffeine <- chent$new("caffeine")
-print(caffeine)
-if (!is.null(caffeine$Picture)) {
- plot(caffeine)
-}
-}
diff --git a/man/pp.Rd b/man/pp.Rd
index 3957de7..cd950df 100644
--- a/man/pp.Rd
+++ b/man/pp.Rd
@@ -4,15 +4,15 @@
\name{pp}
\alias{pp}
\title{R6 class for holding a product with at least one active ingredient}
-\format{An \code{\link{R6Class}} generator object.}
-\usage{
-pp
+\format{
+An \code{\link{R6Class}} generator object.
}
\description{
An R6 class for holding information about a product with at least one active ingredient
}
-\section{Fields}{
-
+\keyword{data}
+\section{Public fields}{
+\if{html}{\out{<div class="r6-fields">}}
\describe{
\item{\code{name}}{The name of the product}
@@ -21,6 +21,57 @@ An R6 class for holding information about a product with at least one active ing
\item{\code{concentrations}}{The concentration of the ais}
\item{\code{concentration_units}}{Defaults to g/L}
-}}
+}
+\if{html}{\out{</div>}}
+}
+\section{Methods}{
+\subsection{Public methods}{
+\itemize{
+\item \href{#method-new}{\code{pp$new()}}
+\item \href{#method-print}{\code{pp$print()}}
+\item \href{#method-clone}{\code{pp$clone()}}
+}
+}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-new"></a>}}
+\if{latex}{\out{\hypertarget{method-new}{}}}
+\subsection{Method \code{new()}}{
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{pp$new(
+ name,
+ ...,
+ concentrations,
+ concentration_units = "g/L",
+ density = 1000,
+ density_units = "g/L"
+)}\if{html}{\out{</div>}}
+}
-\keyword{data}
+}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-print"></a>}}
+\if{latex}{\out{\hypertarget{method-print}{}}}
+\subsection{Method \code{print()}}{
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{pp$print()}\if{html}{\out{</div>}}
+}
+
+}
+\if{html}{\out{<hr>}}
+\if{html}{\out{<a id="method-clone"></a>}}
+\if{latex}{\out{\hypertarget{method-clone}{}}}
+\subsection{Method \code{clone()}}{
+The objects of this class are cloneable with this method.
+\subsection{Usage}{
+\if{html}{\out{<div class="r">}}\preformatted{pp$clone(deep = FALSE)}\if{html}{\out{</div>}}
+}
+
+\subsection{Arguments}{
+\if{html}{\out{<div class="arguments">}}
+\describe{
+\item{\code{deep}}{Whether to make a deep clone.}
+}
+\if{html}{\out{</div>}}
+}
+}
+}
diff --git a/tests/testthat/test_chent.R b/tests/testthat/test_chent.R
index 1fa0852..094ff8b 100644
--- a/tests/testthat/test_chent.R
+++ b/tests/testthat/test_chent.R
@@ -9,14 +9,14 @@ oct <- chent$new("1-octanol", smiles = "CCCCCCCCO", pubchem = FALSE, chyaml = FA
test_that("We can generate a chent object from SMILES using RDKit", {
skip_if_no_rdkit()
- expect_equivalent(round(oct$mw, 2), 130.23)
+ expect_equivalent(round(oct$mw, 2), 130.23)
expect_equal(names(oct$identifier), "X1.octanol")
expect_equal(oct$smiles[["user"]], "CCCCCCCCO")
})
test_that("We can add information retrieved from PubChem via webchem", {
oct$try_pubchem()
- expect_equivalent(round(oct$mw, 2), 130.23)
+ expect_equivalent(round(oct$mw, 2), 130.23)
ik = "KBPLFHHGFOOTCA-UHFFFAOYSA-N"
attr(ik, "source") <- "pubchem"
expect_equal(oct$inchikey, ik)

Contact - Imprint