Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct Alan Woods first name everywhere #24

Merged
merged 1 commit into from
Aug 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generated by roxygen2 (4.1.1): do not edit by hand

export(allanwood)
export(alanwood)
export(cid_compinfo)
export(cir_query)
export(csid_compinfo)
Expand Down
4 changes: 2 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ MINOR IMPROVEMENTS

BUG FIXES


* Correct the spelling of Alan Wood and rename function allanwood() to alanwood()


webchem 0.0.2
Expand All @@ -36,4 +36,4 @@ BUG FIXES
* cts_convert() does not ignore 'first' argument.
* get_csid() did not return NA, if there was a problem with the API.
* Many functions returned 'NA2+' if NA was given - now return NA by default.
* Many fixes in NA handling, e.g. when no hit was found.
* Many fixes in NA handling, e.g. when no hit was found.
12 changes: 6 additions & 6 deletions R/allanwood.R → R/alanwood.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Query http://www.alanwood.net/pesticides
#'
#' Query Allan Woods Compendium of Pesticide Common Names http://www.alanwood.net/pesticides
#' Query Alan Woods Compendium of Pesticide Common Names http://www.alanwood.net/pesticides
#' @import XML RCurl
#'
#' @param x character; search string
Expand All @@ -14,11 +14,11 @@
#' @export
#' @examples
#' \dontrun{
#' allanwood('Fluazinam', type = 'commonname')
#' sapply(c('Fluazinam', 'Diclofop', 'xxxxx'), allanwood, type = 'com')
#' allanwood("79622-59-6", type = 'cas')
#' alanwood('Fluazinam', type = 'commonname')
#' sapply(c('Fluazinam', 'Diclofop', 'xxxxx'), alanwood, type = 'com')
#' alanwood("79622-59-6", type = 'cas')
#' }
allanwood <- function(x, type = c("commonname", "cas"), verbose = TRUE){
alanwood <- function(x, type = c("commonname", "cas"), verbose = TRUE){
type <- match.arg(type)
if (type == 'commonname') {
baseurl <- 'http://www.alanwood.net/pesticides/index_cn.html'
Expand Down Expand Up @@ -75,4 +75,4 @@ allanwood <- function(x, type = c("commonname", "cas"), verbose = TRUE){
iupac_name = iupac_name, cas = cas, formula = formula,
activity = activity, inchikey = inchikey, inch = inchi)
return(out)
}
}
12 changes: 6 additions & 6 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Source | Function(s | API Docs | API key
PubChem | `get_cid()`, `cid_compinfo()` | [link](https://pubchem.ncbi.nlm.nih.gov/) | none
[Chemical Translation Service (CTS)](http://cts.fiehnlab.ucdavis.edu/) | `cts_convert()`, `cts_compinfo()` | none | none
[PAN Pesticide Database](http://www.pesticideinfo.org/) | `pan()` | none | none
[Allan Wood's Compendium of Pesticide Common Names](http://www.alanwood.net/pesticides/) | `allanwood()` | none | none
[Alan Wood's Compendium of Pesticide Common Names](http://www.alanwood.net/pesticides/) | `alanwood()` | none | none
[PHYSPROP Database](http://www.srcinc.com/what-we-do/environmental/scientific-databases.html) | `physprop()` | none | none
[ETOX](http://webetox.uba.de/webETOX/index.do) | `get_etoxid()`, `etox_basic()`. `etox_targets()`, `etox_tests()` | none | none

Expand Down Expand Up @@ -154,12 +154,12 @@ pan_list[c("CAS Number", "Chemical Class", "Water Solubility (Avg, mg/L)", "Adso



#### Allan Wood's Compendium of Pesticide Common Names
#### Alan Wood's Compendium of Pesticide Common Names

`allanwood()` returns a list of 9 entries and can query common names and cas numbers:
```{r allanwood}
allanwood('Fluazinam', type = 'commonname')
allanwood('79622-59-6', type = 'cas')$cname
`alanwood()` returns a list of 9 entries and can query common names and cas numbers:
```{r alanwood}
alanwood('Fluazinam', type = 'commonname')
alanwood('79622-59-6', type = 'cas')$cname
```

#### SRC PHYSPROP Database
Expand Down
45 changes: 13 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
output:
html_document:
keep_md: yes
self_contained: no
---
webchem
=============

Expand All @@ -23,7 +29,7 @@ Source | Function(s | API Docs | API key
PubChem | `get_cid()`, `cid_compinfo()` | [link](https://pubchem.ncbi.nlm.nih.gov/) | none
[Chemical Translation Service (CTS)](http://cts.fiehnlab.ucdavis.edu/) | `cts_convert()`, `cts_compinfo()` | none | none
[PAN Pesticide Database](http://www.pesticideinfo.org/) | `pan()` | none | none
[Allan Wood's Compendium of Pesticide Common Names](http://www.alanwood.net/pesticides/) | `allanwood()` | none | none
[Alan Wood's Compendium of Pesticide Common Names](http://www.alanwood.net/pesticides/) | `alanwood()` | none | none
[PHYSPROP Database](http://www.srcinc.com/what-we-do/environmental/scientific-databases.html) | `physprop()` | none | none
[ETOX](http://webetox.uba.de/webETOX/index.do) | `get_etoxid()`, `etox_basic()`. `etox_targets()`, `etox_tests()` | none | none

Expand Down Expand Up @@ -221,40 +227,15 @@ pan_list[c("CAS Number", "Chemical Class", "Water Solubility (Avg, mg/L)", "Adso



#### Allan Wood's Compendium of Pesticide Common Names
#### Alan Wood's Compendium of Pesticide Common Names

`allanwood()` returns a list of 9 entries and can query common names and cas numbers:
`alanwood()` returns a list of 9 entries and can query common names and cas numbers:

```r
allanwood('Fluazinam', type = 'commonname')
#> $cname
#> [1] "Fluazinam"
#>
#> $status
#> [1] "ISO 1750 (published)"
#>
#> $pref_iupac_name
#> [1] "3-chloro-N-[3-chloro-2,6-dinitro-4-(trifluoromethyl)phenyl]-5-(trifluoromethyl)pyridin-2-amine"
#>
#> $iupac_name
#> [1] "3-chloro-N-(3-chloro-5-trifluoromethyl-2-pyridyl)-α,α,α-trifluoro-2,6-dinitro-p-toluidine"
#>
#> $cas
#> [1] "79622-59-6"
#>
#> $formula
#> [1] "C13H4Cl2F6N4O4"
#>
#> $activity
#> [1] "fungicides (pyridine fungicides)"
#>
#> $inchikey
#> [1] "UZCGKGPEKUCDTF-UHFFFAOYSA-N"
#>
#> $inch
#> [1] "InChI=1S/C13H4Cl2F6N4O4/c14-6-1-4(12(16,17)18)3-22-11(6)23-9-7(24(26)27)2-5(13(19,20)21)8(15)10(9)25(28)29/h1-3H,(H,22,23)"
allanwood('79622-59-6', type = 'cas')$cname
#> [1] "fluazinam"
alanwood('Fluazinam', type = 'commonname')
#> Error in eval(expr, envir, enclos): konnte Funktion "alanwood" nicht finden
alanwood('79622-59-6', type = 'cas')$cname
#> Error in eval(expr, envir, enclos): konnte Funktion "alanwood" nicht finden
```

#### SRC PHYSPROP Database
Expand Down
16 changes: 8 additions & 8 deletions man/allanwood.Rd → man/alanwood.Rd
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
% Generated by roxygen2 (4.1.1): do not edit by hand
% Please edit documentation in R/allanwood.R
\name{allanwood}
\alias{allanwood}
% Please edit documentation in R/alanwood.R
\name{alanwood}
\alias{alanwood}
\title{Query http://www.alanwood.net/pesticides}
\usage{
allanwood(x, type = c("commonname", "cas"), verbose = TRUE)
alanwood(x, type = c("commonname", "cas"), verbose = TRUE)
}
\arguments{
\item{x}{character; search string}
Expand All @@ -18,16 +18,16 @@ A list of eight entries: common-name, status, preferredd IUPAC Name,
IUPAC Name, cas, formula, activity, inchikey, inchi
}
\description{
Query Allan Woods Compendium of Pesticide Common Names http://www.alanwood.net/pesticides
Query Alan Woods Compendium of Pesticide Common Names http://www.alanwood.net/pesticides
}
\note{
for type = 'cas' only the first link is returned
}
\examples{
\dontrun{
allanwood('Fluazinam', type = 'commonname')
sapply(c('Fluazinam', 'Diclofop', 'xxxxx'), allanwood, type = 'com')
allanwood("79622-59-6", type = 'cas')
alanwood('Fluazinam', type = 'commonname')
sapply(c('Fluazinam', 'Diclofop', 'xxxxx'), alanwood, type = 'com')
alanwood("79622-59-6", type = 'cas')
}
}
\author{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
context("allanwood")
context("alanwood")

test_that("allanwood, commonname", {
fl <- allanwood('Fluazinam', type = 'commonname')
xx <- allanwood('xxxxx', type = 'commonname')
test_that("alanwood, commonname", {
fl <- alanwood('Fluazinam', type = 'commonname')
xx <- alanwood('xxxxx', type = 'commonname')

expect_equal(fl$cas, "79622-59-6", verbose = FALSE)
expect_equal(xx, NA, verbose = FALSE)
expect_equal(length(fl), 9)
})


test_that("allanwood, cas", {
cs <- allanwood("79622-59-6", type = 'cas')
xx <- allanwood('xxxxx', type = 'cas')
test_that("alanwood, cas", {
cs <- alanwood("79622-59-6", type = 'cas')
xx <- alanwood('xxxxx', type = 'cas')

expect_equal(cs$cas, "79622-59-6", verbose = FALSE)
expect_equal(cs$cname, "fluazinam", verbose = FALSE)
Expand Down