ritis/0000755000176200001440000000000013177057371011417 5ustar liggesusersritis/inst/0000755000176200001440000000000013176715441012372 5ustar liggesusersritis/inst/doc/0000755000176200001440000000000013176715441013137 5ustar liggesusersritis/inst/doc/ritis_vignette.Rmd0000644000176200001440000001300612777474350016651 0ustar liggesusers ritis introduction ================== An interface to the Integrated Taxonomic Information System (ITIS) ## Installation Install from CRAN ```r install.packages("ritis") ``` Or install the development version from GitHub ```r devtools::install_github("ropensci/ritis") ``` Load `ritis` ```r library("ritis") ``` ## ITIS Solr interface There are four methods. * `itis_search()` - Search * `itis_group()` - Group * `itis_highlight()` - Hightlight * `itis_facet()` - Facet These four methods use the equivalent functions in the package `solrium`, e.g., `ritis::itis_search()` uses `solrium::solr_search()`, etc. The `itis_*()` functions simply use `...` to allow users to pass on parameters to the wrapped `solrium` functions. So do read the `solrium` docs. ITIS Solr API docs: Some examples: matches only monomials ```r itis_search(q = "nameWOInd:/[A-Za-z0-9]*[%20]{0,0}*/") #> # A tibble: 10 × 27 #> tsn nameWInd nameWOInd unit1 usage #> #> 1 51 Schizomycetes Schizomycetes Schizomycetes invalid #> 2 50 Bacteria Bacteria Bacteria valid #> 3 52 Archangiaceae Archangiaceae Archangiaceae invalid #> 4 53 Pseudomonadales Pseudomonadales Pseudomonadales valid #> 5 54 Rhodobacteriineae Rhodobacteriineae Rhodobacteriineae invalid #> 6 55 Pseudomonadineae Pseudomonadineae Pseudomonadineae invalid #> 7 56 Nitrobacteraceae Nitrobacteraceae Nitrobacteraceae invalid #> 8 57 Nitrobacter Nitrobacter Nitrobacter valid #> 9 65 Nitrosomonas Nitrosomonas Nitrosomonas valid #> 10 70 Thiobacteriaceae Thiobacteriaceae Thiobacteriaceae invalid #> # ... with 22 more variables: unacceptReason , #> # credibilityRating , completenessRating , #> # currencyRating , kingdom , rankID , rank , #> # hierarchySoFar , hierarchySoFarWRanks , hierarchyTSN , #> # synonyms , synonymTSNs , otherSource , #> # acceptedTSN , comment , createDate , updateDate , #> # `_version_` , taxonAuthor , vernacular , #> # hierarchicalSort , parentTSN ``` matches only binomials ```r itis_search(q = "nameWOInd:/[A-Za-z0-9]*[%20]{1,1}[A-Za-z0-9]*/") #> # A tibble: 10 × 25 #> tsn nameWInd nameWOInd unit1 #> #> 1 58 Nitrobacter agilis Nitrobacter agilis Nitrobacter #> 2 59 Nitrobacter flavus Nitrobacter flavus Nitrobacter #> 3 60 Nitrobacter oligotrophis Nitrobacter oligotrophis Nitrobacter #> 4 61 Nitrobacter polytrophus Nitrobacter polytrophus Nitrobacter #> 5 62 Nitrobacter punctata Nitrobacter punctata Nitrobacter #> 6 64 Nitrobacter winogradskyi Nitrobacter winogradskyi Nitrobacter #> 7 66 Nitrosomonas europaea Nitrosomonas europaea Nitrosomonas #> 8 67 Nitrosomonas groningensis Nitrosomonas groningensis Nitrosomonas #> 9 68 Nitrosomonas javenensis Nitrosomonas javenensis Nitrosomonas #> 10 69 Nitrosomonas monocella Nitrosomonas monocella Nitrosomonas #> # ... with 21 more variables: unit2 , usage , #> # unacceptReason , credibilityRating , kingdom , #> # rankID , rank , hierarchySoFar , #> # hierarchySoFarWRanks , hierarchyTSN , synonyms , #> # synonymTSNs , otherSource , acceptedTSN , #> # comment , createDate , updateDate , `_version_` , #> # taxonAuthor , parentTSN , hierarchicalSort ``` ## ITIS REST API interface ITIS REST API docs: The following are some example uses. There are many more methods not shown below ------- Get accepted names for a TSN ```r accepted_names(tsn = 504239) #> # A tibble: 1 × 3 #> acceptedName acceptedTsn author #> #> 1 Dasiphora fruticosa 836659 (L.) Rydb. ``` Get common names for a TSN ```r common_names(tsn = 183833) #> # A tibble: 3 × 3 #> commonName language tsn #> #> 1 African hunting dog English 183833 #> 2 African Wild Dog English 183833 #> 3 Painted Hunting Dog English 183833 ``` Full hierarchy for a TSN ```r hierarchy_full(tsn = 37906) #> # A tibble: 60 × 5 #> parentname parenttsn rankname taxonname tsn #> * #> 1 Kingdom Plantae 202422 #> 2 Plantae 202422 Subkingdom Viridiplantae 954898 #> 3 Viridiplantae 954898 Infrakingdom Streptophyta 846494 #> 4 Streptophyta 846494 Superdivision Embryophyta 954900 #> 5 Embryophyta 954900 Division Tracheophyta 846496 #> 6 Tracheophyta 846496 Subdivision Spermatophytina 846504 #> 7 Spermatophytina 846504 Class Magnoliopsida 18063 #> 8 Magnoliopsida 18063 Superorder Asteranae 846535 #> 9 Asteranae 846535 Order Asterales 35419 #> 10 Asterales 35419 Family Asteraceae 35420 #> # ... with 50 more rows ``` ritis/inst/doc/ritis_vignette.html0000644000176200001440000004722513176715440017075 0ustar liggesusers ritis introduction

ritis introduction

An interface to the Integrated Taxonomic Information System (ITIS)

Installation

Install from CRAN

install.packages("ritis")

Or install the development version from GitHub

devtools::install_github("ropensci/ritis")

Load ritis

library("ritis")

ITIS Solr interface

There are four methods.

  • itis_search() - Search
  • itis_group() - Group
  • itis_highlight() - Hightlight
  • itis_facet() - Facet

These four methods use the equivalent functions in the package solrium, e.g., ritis::itis_search() uses solrium::solr_search(), etc. The itis_*() functions simply use ... to allow users to pass on parameters to the wrapped solrium functions. So do read the solrium docs.

ITIS Solr API docs: https://www.itis.gov/solr_documentation.html

Some examples:

matches only monomials

itis_search(q = "nameWOInd:/[A-Za-z0-9]*[%20]{0,0}*/")
#> # A tibble: 10 × 27
#>      tsn          nameWInd         nameWOInd             unit1   usage
#>    <chr>             <chr>             <chr>             <chr>   <chr>
#> 1     51     Schizomycetes     Schizomycetes     Schizomycetes invalid
#> 2     50          Bacteria          Bacteria          Bacteria   valid
#> 3     52     Archangiaceae     Archangiaceae     Archangiaceae invalid
#> 4     53   Pseudomonadales   Pseudomonadales   Pseudomonadales   valid
#> 5     54 Rhodobacteriineae Rhodobacteriineae Rhodobacteriineae invalid
#> 6     55  Pseudomonadineae  Pseudomonadineae  Pseudomonadineae invalid
#> 7     56  Nitrobacteraceae  Nitrobacteraceae  Nitrobacteraceae invalid
#> 8     57       Nitrobacter       Nitrobacter       Nitrobacter   valid
#> 9     65      Nitrosomonas      Nitrosomonas      Nitrosomonas   valid
#> 10    70  Thiobacteriaceae  Thiobacteriaceae  Thiobacteriaceae invalid
#> # ... with 22 more variables: unacceptReason <chr>,
#> #   credibilityRating <chr>, completenessRating <chr>,
#> #   currencyRating <chr>, kingdom <chr>, rankID <chr>, rank <chr>,
#> #   hierarchySoFar <chr>, hierarchySoFarWRanks <chr>, hierarchyTSN <chr>,
#> #   synonyms <chr>, synonymTSNs <chr>, otherSource <chr>,
#> #   acceptedTSN <chr>, comment <chr>, createDate <chr>, updateDate <chr>,
#> #   `_version_` <dbl>, taxonAuthor <chr>, vernacular <chr>,
#> #   hierarchicalSort <chr>, parentTSN <chr>

matches only binomials

itis_search(q = "nameWOInd:/[A-Za-z0-9]*[%20]{1,1}[A-Za-z0-9]*/")
#> # A tibble: 10 × 25
#>      tsn                  nameWInd                 nameWOInd        unit1
#>    <chr>                     <chr>                     <chr>        <chr>
#> 1     58        Nitrobacter agilis        Nitrobacter agilis  Nitrobacter
#> 2     59        Nitrobacter flavus        Nitrobacter flavus  Nitrobacter
#> 3     60  Nitrobacter oligotrophis  Nitrobacter oligotrophis  Nitrobacter
#> 4     61   Nitrobacter polytrophus   Nitrobacter polytrophus  Nitrobacter
#> 5     62      Nitrobacter punctata      Nitrobacter punctata  Nitrobacter
#> 6     64  Nitrobacter winogradskyi  Nitrobacter winogradskyi  Nitrobacter
#> 7     66     Nitrosomonas europaea     Nitrosomonas europaea Nitrosomonas
#> 8     67 Nitrosomonas groningensis Nitrosomonas groningensis Nitrosomonas
#> 9     68   Nitrosomonas javenensis   Nitrosomonas javenensis Nitrosomonas
#> 10    69    Nitrosomonas monocella    Nitrosomonas monocella Nitrosomonas
#> # ... with 21 more variables: unit2 <chr>, usage <chr>,
#> #   unacceptReason <chr>, credibilityRating <chr>, kingdom <chr>,
#> #   rankID <chr>, rank <chr>, hierarchySoFar <chr>,
#> #   hierarchySoFarWRanks <chr>, hierarchyTSN <chr>, synonyms <chr>,
#> #   synonymTSNs <chr>, otherSource <chr>, acceptedTSN <chr>,
#> #   comment <chr>, createDate <chr>, updateDate <chr>, `_version_` <dbl>,
#> #   taxonAuthor <chr>, parentTSN <chr>, hierarchicalSort <chr>

ITIS REST API interface

ITIS REST API docs: http://www.itis.gov/ws_description.html

The following are some example uses. There are many more methods not shown below


Get accepted names for a TSN

accepted_names(tsn = 504239)
#> # A tibble: 1 × 3
#>          acceptedName acceptedTsn     author
#>                 <chr>       <chr>      <chr>
#> 1 Dasiphora fruticosa      836659 (L.) Rydb.

Get common names for a TSN

common_names(tsn = 183833)
#> # A tibble: 3 × 3
#>            commonName language    tsn
#>                 <chr>    <chr>  <chr>
#> 1 African hunting dog  English 183833
#> 2    African Wild Dog  English 183833
#> 3 Painted Hunting Dog  English 183833

Full hierarchy for a TSN

hierarchy_full(tsn = 37906)
#> # A tibble: 60 × 5
#>         parentname parenttsn      rankname       taxonname    tsn
#> *            <chr>     <chr>         <chr>           <chr>  <chr>
#> 1                                  Kingdom         Plantae 202422
#> 2          Plantae    202422    Subkingdom   Viridiplantae 954898
#> 3    Viridiplantae    954898  Infrakingdom    Streptophyta 846494
#> 4     Streptophyta    846494 Superdivision     Embryophyta 954900
#> 5      Embryophyta    954900      Division    Tracheophyta 846496
#> 6     Tracheophyta    846496   Subdivision Spermatophytina 846504
#> 7  Spermatophytina    846504         Class   Magnoliopsida  18063
#> 8    Magnoliopsida     18063    Superorder       Asteranae 846535
#> 9        Asteranae    846535         Order       Asterales  35419
#> 10       Asterales     35419        Family      Asteraceae  35420
#> # ... with 50 more rows
ritis/inst/vign/0000755000176200001440000000000012732402574013332 5ustar liggesusersritis/inst/vign/ritis_vignette.Rmd0000644000176200001440000000323712777474313017053 0ustar liggesusers ```{r echo=FALSE} knitr::opts_chunk$set( comment = "#>", collapse = TRUE, warning = FALSE, message = FALSE ) ``` ritis introduction ================== An interface to the Integrated Taxonomic Information System (ITIS) ## Installation Install from CRAN ```{r eval=FALSE} install.packages("ritis") ``` Or install the development version from GitHub ```{r installgh, eval=FALSE} devtools::install_github("ropensci/ritis") ``` Load `ritis` ```{r} library("ritis") ``` ## ITIS Solr interface There are four methods. * `itis_search()` - Search * `itis_group()` - Group * `itis_highlight()` - Hightlight * `itis_facet()` - Facet These four methods use the equivalent functions in the package `solrium`, e.g., `ritis::itis_search()` uses `solrium::solr_search()`, etc. The `itis_*()` functions simply use `...` to allow users to pass on parameters to the wrapped `solrium` functions. So do read the `solrium` docs. ITIS Solr API docs: Some examples: matches only monomials ```{r} itis_search(q = "nameWOInd:/[A-Za-z0-9]*[%20]{0,0}*/") ``` matches only binomials ```{r} itis_search(q = "nameWOInd:/[A-Za-z0-9]*[%20]{1,1}[A-Za-z0-9]*/") ``` ## ITIS REST API interface ITIS REST API docs: The following are some example uses. There are many more methods not shown below ------- Get accepted names for a TSN ```{r} accepted_names(tsn = 504239) ``` Get common names for a TSN ```{r} common_names(tsn = 183833) ``` Full hierarchy for a TSN ```{r} hierarchy_full(tsn = 37906) ``` ritis/inst/vign/ritis_vignette.md0000644000176200001440000001300612777474333016726 0ustar liggesusers ritis introduction ================== An interface to the Integrated Taxonomic Information System (ITIS) ## Installation Install from CRAN ```r install.packages("ritis") ``` Or install the development version from GitHub ```r devtools::install_github("ropensci/ritis") ``` Load `ritis` ```r library("ritis") ``` ## ITIS Solr interface There are four methods. * `itis_search()` - Search * `itis_group()` - Group * `itis_highlight()` - Hightlight * `itis_facet()` - Facet These four methods use the equivalent functions in the package `solrium`, e.g., `ritis::itis_search()` uses `solrium::solr_search()`, etc. The `itis_*()` functions simply use `...` to allow users to pass on parameters to the wrapped `solrium` functions. So do read the `solrium` docs. ITIS Solr API docs: Some examples: matches only monomials ```r itis_search(q = "nameWOInd:/[A-Za-z0-9]*[%20]{0,0}*/") #> # A tibble: 10 × 27 #> tsn nameWInd nameWOInd unit1 usage #> #> 1 51 Schizomycetes Schizomycetes Schizomycetes invalid #> 2 50 Bacteria Bacteria Bacteria valid #> 3 52 Archangiaceae Archangiaceae Archangiaceae invalid #> 4 53 Pseudomonadales Pseudomonadales Pseudomonadales valid #> 5 54 Rhodobacteriineae Rhodobacteriineae Rhodobacteriineae invalid #> 6 55 Pseudomonadineae Pseudomonadineae Pseudomonadineae invalid #> 7 56 Nitrobacteraceae Nitrobacteraceae Nitrobacteraceae invalid #> 8 57 Nitrobacter Nitrobacter Nitrobacter valid #> 9 65 Nitrosomonas Nitrosomonas Nitrosomonas valid #> 10 70 Thiobacteriaceae Thiobacteriaceae Thiobacteriaceae invalid #> # ... with 22 more variables: unacceptReason , #> # credibilityRating , completenessRating , #> # currencyRating , kingdom , rankID , rank , #> # hierarchySoFar , hierarchySoFarWRanks , hierarchyTSN , #> # synonyms , synonymTSNs , otherSource , #> # acceptedTSN , comment , createDate , updateDate , #> # `_version_` , taxonAuthor , vernacular , #> # hierarchicalSort , parentTSN ``` matches only binomials ```r itis_search(q = "nameWOInd:/[A-Za-z0-9]*[%20]{1,1}[A-Za-z0-9]*/") #> # A tibble: 10 × 25 #> tsn nameWInd nameWOInd unit1 #> #> 1 58 Nitrobacter agilis Nitrobacter agilis Nitrobacter #> 2 59 Nitrobacter flavus Nitrobacter flavus Nitrobacter #> 3 60 Nitrobacter oligotrophis Nitrobacter oligotrophis Nitrobacter #> 4 61 Nitrobacter polytrophus Nitrobacter polytrophus Nitrobacter #> 5 62 Nitrobacter punctata Nitrobacter punctata Nitrobacter #> 6 64 Nitrobacter winogradskyi Nitrobacter winogradskyi Nitrobacter #> 7 66 Nitrosomonas europaea Nitrosomonas europaea Nitrosomonas #> 8 67 Nitrosomonas groningensis Nitrosomonas groningensis Nitrosomonas #> 9 68 Nitrosomonas javenensis Nitrosomonas javenensis Nitrosomonas #> 10 69 Nitrosomonas monocella Nitrosomonas monocella Nitrosomonas #> # ... with 21 more variables: unit2 , usage , #> # unacceptReason , credibilityRating , kingdom , #> # rankID , rank , hierarchySoFar , #> # hierarchySoFarWRanks , hierarchyTSN , synonyms , #> # synonymTSNs , otherSource , acceptedTSN , #> # comment , createDate , updateDate , `_version_` , #> # taxonAuthor , parentTSN , hierarchicalSort ``` ## ITIS REST API interface ITIS REST API docs: The following are some example uses. There are many more methods not shown below ------- Get accepted names for a TSN ```r accepted_names(tsn = 504239) #> # A tibble: 1 × 3 #> acceptedName acceptedTsn author #> #> 1 Dasiphora fruticosa 836659 (L.) Rydb. ``` Get common names for a TSN ```r common_names(tsn = 183833) #> # A tibble: 3 × 3 #> commonName language tsn #> #> 1 African hunting dog English 183833 #> 2 African Wild Dog English 183833 #> 3 Painted Hunting Dog English 183833 ``` Full hierarchy for a TSN ```r hierarchy_full(tsn = 37906) #> # A tibble: 60 × 5 #> parentname parenttsn rankname taxonname tsn #> * #> 1 Kingdom Plantae 202422 #> 2 Plantae 202422 Subkingdom Viridiplantae 954898 #> 3 Viridiplantae 954898 Infrakingdom Streptophyta 846494 #> 4 Streptophyta 846494 Superdivision Embryophyta 954900 #> 5 Embryophyta 954900 Division Tracheophyta 846496 #> 6 Tracheophyta 846496 Subdivision Spermatophytina 846504 #> 7 Spermatophytina 846504 Class Magnoliopsida 18063 #> 8 Magnoliopsida 18063 Superorder Asteranae 846535 #> 9 Asteranae 846535 Order Asterales 35419 #> 10 Asterales 35419 Family Asteraceae 35420 #> # ... with 50 more rows ``` ritis/tests/0000755000176200001440000000000013176715441012557 5ustar liggesusersritis/tests/testthat/0000755000176200001440000000000013176715441014417 5ustar liggesusersritis/tests/testthat/test-jurisdiction.R0000644000176200001440000000205713011432216020211 0ustar liggesuserscontext("jurisdiction functions") test_that("jurisdictional_origin basic functionality works", { skip_on_cran() aa <- jurisdictional_origin(tsn=180543) expect_is(aa, "data.frame") expect_is(aa, "tbl_df") expect_is(aa$origin, "character") expect_gt(NROW(aa), 0) }) test_that("jurisdiction_origin_values - basic functionality works", { skip_on_cran() aa <- jurisdiction_origin_values() expect_is(aa, "data.frame") expect_is(aa, "tbl_df") expect_named(aa, c('jurisdiction', 'origin')) }) test_that("jurisdiction_values - basic functionality works", { skip_on_cran() aa <- jurisdiction_values() expect_is(aa, "character") expect_gt(length(aa), 1) }) test_that("jurisdiction functions fail well", { skip_on_cran() expect_error(jurisdictional_origin(), "\"tsn\" is missing") expect_error(jurisdiction_origin_values(wt = "ffa"), "'wt' must be one of") expect_error(jurisdiction_values(wt = "ffa"), "'wt' must be one of") # lsid's not found lead 404 expect_error(jurisdictional_origin(tsn = "asdfasdf"), "Not Found") }) ritis/tests/testthat/test-itis_group.R0000644000176200001440000000070012732550774017703 0ustar liggesuserscontext("itis_group") test_that("itis_group basic functionality works", { skip_on_cran() aa <- sm(itis_group(q = "nameWOInd:/[A-Za-z0-9]*[%20]{1,1}[A-Za-z0-9]*/", group.field = 'rank', group.limit = 3)) expect_is(aa, "data.frame") expect_true(any(grepl("group", names(aa)))) }) test_that("itis_group fails well", { skip_on_cran() expect_error(sm(itis_group())) expect_error(sm(itis_group(wt = "asdfaddf"))) }) ritis/tests/testthat/test-itis_search.R0000644000176200001440000000134412732542122020005 0ustar liggesuserscontext("itis_search") test_that("itis_search basic functionality works", { skip_on_cran() aa <- sm(itis_search(q = "tsn:182662")) bb <- sm(itis_search(q = "nameWOInd:Liquidamber\\%20styraciflua~0.4")) cc <- sm(itis_search(q = "nameWOInd:/[A-Ba-z0-9]*[%20]{0,0}*/")) expect_is(aa, "data.frame") expect_is(bb, "data.frame") expect_is(cc, "data.frame") expect_is(aa$tsn, "character") expect_true(grepl("Liquidambar", bb$nameWInd)) expect_false(all(grepl("[C-D]", substring(cc$nameWOInd, 1, 1)))) }) test_that("itis_search fails well", { skip_on_cran() expect_identical( sm(itis_search(foo = "bar")), sm(itis_search()) ) expect_error(itis_search(wt = "asdfaddf"), "must be one of") }) ritis/tests/testthat/test-hierarchy.R0000644000176200001440000000222013070300656017460 0ustar liggesuserscontext("hierarchy functions") test_that("hierarchy_down basic functionality works", { skip_on_cran() aa <- hierarchy_down(tsn = 179913) expect_is(aa, "data.frame") expect_is(aa, "tbl_df") expect_is(aa$tsn, "character") expect_gt(NROW(aa), 0) }) test_that("hierarchy_up basic functionality works", { skip_on_cran() aa <- hierarchy_up(tsn = 36485) expect_is(aa, "data.frame") expect_is(aa, "tbl_df") expect_is(aa$tsn, "character") expect_gt(NROW(aa), 0) }) test_that("hierarchy_full basic functionality works", { skip_on_cran() aa <- hierarchy_full(tsn = 37906) expect_is(aa, "data.frame") expect_is(aa, "tbl_df") expect_is(aa$tsn, "character") expect_gt(NROW(aa), 0) }) test_that("hierarchy functions fail well", { skip_on_cran() expect_error(hierarchy_down(), "\"tsn\" is missing") expect_error(hierarchy_up(), "\"tsn\" is missing") expect_error(hierarchy_full(), "\"tsn\" is missing") # tsn's not found gives 404 expect_error(hierarchy_down(tsn = "Asdfasdfa"), "Not Found") expect_error(hierarchy_up(tsn = "Asdfasdfa"), "Not Found") expect_error(hierarchy_full(tsn = "Asdfasdfa"), "Not Found") }) ritis/tests/testthat/test-search_scientific.R0000644000176200001440000000175612732566405021176 0ustar liggesuserscontext("search_scientific") test_that("search_scientific basic functionality works", { skip_on_cran() aa <- search_scientific("Tardigrada") expect_is(aa, "data.frame") expect_is(aa, "tbl_df") expect_is(aa$tsn, "character") expect_gt(NROW(aa), 0) }) test_that("search_scientific - xml works", { skip_on_cran() aa <- search_scientific("Tardigrada", wt = "xml") expect_is(aa, "character") expect_true(grepl("xmlns", aa)) }) test_that("search_scientific - raw JSON works", { skip_on_cran() aa <- search_scientific("Tardigrada", raw = TRUE) expect_is(aa, "character") expect_false(grepl("xmlns", aa)) }) test_that("search_scientific fails well", { skip_on_cran() expect_error(search_scientific(), "\"x\" is missing") expect_error(search_scientific("asdfadf", wt = "ffa"), "'wt' must be one of") # query with no results lead to 0 row data.frame's tmp <- search_scientific(x = "asdfadf", wt = "json") expect_is(tmp, "tbl_df") expect_equal(NROW(tmp), 0) }) ritis/tests/testthat/test-search_common.R0000644000176200001440000000172612732567132020341 0ustar liggesuserscontext("search_common") test_that("search_common basic functionality works", { skip_on_cran() aa <- search_common(x = "american bullfrog") expect_is(aa, "data.frame") expect_is(aa, "tbl_df") expect_is(aa$tsn, "character") expect_gt(NROW(aa), 0) }) test_that("search_common - xml works", { skip_on_cran() aa <- search_common(x = "american bullfrog", wt = "xml") expect_is(aa, "character") expect_true(grepl("xmlns", aa)) }) test_that("search_common - raw JSON works", { skip_on_cran() aa <- search_common(x = "american bullfrog", raw = TRUE) expect_is(aa, "character") expect_false(grepl("xmlns", aa)) }) test_that("search_common fails well", { skip_on_cran() expect_error(search_common(), "\"x\" is missing") expect_error(search_common("asdfadf", wt = "ffa"), "'wt' must be one of") # query with no results lead to 0 row data.frame's tmp <- search_common(x = "asdfadf") expect_is(tmp, "tbl_df") expect_equal(NROW(tmp), 0) }) ritis/tests/testthat/test-itis_highlight.R0000644000176200001440000000105613174373565020525 0ustar liggesuserscontext("itis_highlight") test_that("itis_highlight basic functionality works", { skip_on_cran() aa <- sm(itis_highlight(q = "rank:Species", hl.fl = 'rank', rows = 10)) expect_is(aa, "tbl_df") expect_is(aa$rank[1], "character") expect_is(aa$names[1], "character") expect_named(aa, c("names", "rank")) }) test_that("itis_highlight fails well", { skip_on_cran() expect_error(sm(itis_highlight(foo = "bar")), "some keys not in acceptable set") expect_error(sm(itis_highlight(wt = "asdfaddf")), "wt must be one of") }) ritis/tests/testthat/test-publications.R0000644000176200001440000000156113011432245020200 0ustar liggesuserscontext("publications") test_that("publications basic functionality works", { skip_on_cran() aa <- publications(tsn = 70340) expect_is(aa, "data.frame") expect_is(aa, "tbl_df") expect_is(aa$isbn, "character") expect_gt(NROW(aa), 0) }) test_that("publications - xml works", { skip_on_cran() aa <- publications(tsn = 70340, wt = "xml") expect_is(aa, "character") expect_match(aa, "xmlns") }) test_that("publications - raw JSON works", { skip_on_cran() aa <- publications(tsn = 70340, raw = TRUE) expect_is(aa, "character") expect_false(grepl("xmlns", aa)) }) test_that("publications fails well", { skip_on_cran() expect_error(publications(), "\"tsn\" is missing") expect_error(publications(tsn = 70340, wt = "ffa"), "'wt' must be one of") # tsn's not found lead to 404 expect_error(publications(tsn = "Asdfasdfa"), "Not Found") }) ritis/tests/testthat/helper.R0000644000176200001440000000004612732402574016016 0ustar liggesuserssm <- function(x) suppressMessages(x) ritis/tests/testthat/test-any_match_count.R0000644000176200001440000000216212732573247020676 0ustar liggesuserscontext("any_match_count") test_that("any_match_count basic functionality works", { skip_on_cran() aa <- any_match_count(x = 202385) expect_true(class(aa) %in% c('numeric', 'integer')) expect_gt(aa, 0) bb <- any_match_count(x = "dolphin") expect_true(class(bb) %in% c('numeric', 'integer')) expect_gt(bb, 0) }) test_that("any_match_count - xml works", { skip_on_cran() aa <- any_match_count(202385, wt = "xml") expect_is(aa, "character") expect_true(grepl("xmlns", aa)) }) test_that("any_match_count - raw JSON works", { skip_on_cran() aa <- any_match_count(202385, raw = TRUE) expect_is(aa, "character") expect_false(grepl("xmlns", aa)) }) test_that("any_match_count fails well", { skip_on_cran() expect_error(any_match_count(), "\"x\" is missing") expect_error(any_match_count("asdfafasffd", wt = "ffa"), "'wt' must be one of") # character string query with no results lead to values of "0" tmp <- any_match_count(x = "asdfadf") expect_equal(tmp, 0) # numeric query with no results lead to values of "0" tmp <- any_match_count(x = 343423432423424) expect_equal(tmp, 0) }) ritis/tests/testthat/test-record.R0000644000176200001440000000173712732564335017006 0ustar liggesuserscontext("record") test_that("record basic functionality works", { skip_on_cran() aa <- record(lsid = "urn:lsid:itis.gov:itis_tsn:180543") expect_is(aa, "data.frame") expect_is(aa, "tbl_df") expect_is(aa$lsid, "character") expect_gt(NROW(aa), 0) }) test_that("record - xml works", { skip_on_cran() aa <- record(lsid = "urn:lsid:itis.gov:itis_tsn:180543", wt = "xml") expect_is(aa, "character") expect_match(aa, "xmlns") }) test_that("record - raw JSON works", { skip_on_cran() aa <- record(lsid = "urn:lsid:itis.gov:itis_tsn:180543", raw = TRUE) expect_is(aa, "character") expect_false(grepl("xmlns", aa)) }) test_that("record fail well", { skip_on_cran() expect_error(record(), "\"lsid\" is missing") expect_error(record(lsid = "urn:lsid:itis.gov:itis_tsn:180543", wt = "ffa"), "'wt' must be one of") # lsid's not found lead to 0 row data.frame's tmp <- record(lsid = "asdfasdf") expect_is(tmp, "tbl_df") expect_equal(NROW(tmp), 0) }) ritis/tests/testthat/test-kingdoms.R0000644000176200001440000000156013011432231017311 0ustar liggesuserscontext("kingdom functions") test_that("kingdom_name basic functionality works", { skip_on_cran() aa <- kingdom_name(202385) expect_is(aa, "data.frame") expect_is(aa, "tbl_df") expect_is(aa$tsn, "character") expect_is(aa$kingdomname, "character") expect_equal(aa$kingdomname, "Animalia") expect_gt(NROW(aa), 0) }) test_that("kingdom_names basic functionality works", { skip_on_cran() aa <- kingdom_names() expect_is(aa, "data.frame") expect_is(aa, "tbl_df") expect_is(aa$tsn, "character") expect_gt(NROW(aa), 0) expect_true(any(grepl("Fungi", aa$kingdomname))) }) test_that("kingdom functions fail well", { skip_on_cran() expect_error(kingdom_name(), "\"tsn\" is missing") expect_error(kingdom_names(wt = "ffa"), "'wt' must be one of") # tsn's not found lead to 404 expect_error(kingdom_name(tsn = "Asdfasdfa"), "Not Found") }) ritis/tests/testthat/test-itis_facet.R0000644000176200001440000000131413174373354017631 0ustar liggesuserscontext("itis_facet") test_that("itis_facet basic functionality works", { skip_on_cran() aa <- sm(itis_facet(q = "rank:Species", rows = 0, facet.field = "kingdom")) expect_is(aa, "list") expect_is(aa$facet_fields, "list") expect_is(aa$facet_fields[[1]], "data.frame") expect_null(aa$facet_queries) expect_null(aa$facet_pivot) expect_null(aa$facet_dates) expect_null(aa$facet_ranges) expect_named(aa$facet_fields, "kingdom") expect_named(aa$facet_fields[[1]], c('term', 'value')) }) test_that("itis_facet fails well", { skip_on_cran() expect_error(itis_facet(foo = "bar"), "didn't detect any facet. fields") expect_error(itis_facet(wt = "asdfaddf"), "wt must be one of") }) ritis/tests/test-all.R0000644000176200001440000000005012732402574014417 0ustar liggesuserslibrary("testthat") test_check("ritis") ritis/NAMESPACE0000644000176200001440000000224313064530750012627 0ustar liggesusers# Generated by roxygen2: do not edit by hand export(accepted_names) export(any_match_count) export(comment_detail) export(common_names) export(core_metadata) export(coverage) export(credibility_rating) export(credibility_ratings) export(currency) export(date_data) export(description) export(experts) export(full_record) export(geographic_divisions) export(geographic_values) export(global_species_completeness) export(hierarchy_down) export(hierarchy_full) export(hierarchy_up) export(itis_facet) export(itis_group) export(itis_highlight) export(itis_search) export(jurisdiction_origin_values) export(jurisdiction_values) export(jurisdictional_origin) export(kingdom_name) export(kingdom_names) export(last_change_date) export(lsid2tsn) export(other_sources) export(parent_tsn) export(publications) export(rank_name) export(rank_names) export(record) export(review_year) export(scientific_name) export(search_any_match_paged) export(search_anymatch) export(search_common) export(search_scientific) export(synonym_names) export(taxon_authorship) export(terms) export(tsn2lsid) export(tsn_by_vernacular_language) export(unacceptability_reason) export(usage) export(vernacular_languages) ritis/NEWS.md0000644000176200001440000000213613176666477012533 0ustar liggesusersritis 0.7.0 =========== ### NEW FEATURES * Now using new version of `solrium` package - users shouldn't see any differences (#9) ritis 0.6.0 =========== ### NEW FEATURES * Now using `crul` as underlying HTTP client (#5) ### BUG FIXES * Base URL change for Solr service from `http` to `https` (#8) * Fixed JSON parsing problem (#6) ritis 0.5.4 =========== ### BUG FIXES * Base URL changed from `http` to `https`, was causing problems in some requests, but not others. Changed to `https` (#4) ritis 0.5.0 =========== ### NEW FEATURES * Re-released to CRAN * Complete overhaul of the package API, simplifying all function interfaces, using JSON by default, shorter names, reduce code reuse. * Added functions for interacting with ITIS's new Solr interface via use of `solrium` ritis 0.0.3 =========== ### BUG FIXES * Removed dependency on plyr - moved from laply to lapply across functions. ritis 0.0.2 =========== ### BUG FIXES * Temporarily removed all tests until they can be fixed and updated, and so that package passes checks. ritis 0.0.1 =========== ### NEW FEATURES * released to CRAN ritis/R/0000755000176200001440000000000013176715441011616 5ustar liggesusersritis/R/onload.R0000644000176200001440000000027513174263434013217 0ustar liggesusersconn_itis <- NULL .onLoad <- function(libname, pkgname){ x <- solrium::SolrClient$new(host = "services.itis.gov", scheme = "https", port = NULL, errors = "complete") conn_itis <<- x } ritis/R/search_any_match_paged.R0000644000176200001440000000234013162615652016366 0ustar liggesusers#' Search for any matched page #' #' @export #' @inheritParams accepted_names #' @inheritParams any_match_count #' @return a data.frame #' @param pagesize An integer containing the page size (numeric) #' @param pagenum An integer containing the page number (numeric) #' @param ascend A boolean containing true for ascending sort order or false #' for descending (logical) #' @return a data.frame #' @seealso \code{\link{search_anymatch}} #' @examples \dontrun{ #' search_any_match_paged(x=202385, pagesize=100, pagenum=1, ascend=FALSE) #' search_any_match_paged(x="Zy", pagesize=100, pagenum=1, ascend=FALSE) #' } search_any_match_paged <- function(x, pagesize = NULL, pagenum = NULL, ascend = NULL, wt = "json", raw = FALSE, ...) { args <- tc(list(srchKey=x, pageSize=pagesize, pageNum=pagenum, ascend=ascend)) out <- itis_GET("searchForAnyMatchPaged", args, wt, ...) if (raw || wt == "xml") return(out) x <- parse_raw(out)$anyMatchList tmp <- dr_op(bindlist(x$commonNameList.commonNames), "class") names(tmp) <- paste0("common_", names(tmp)) x <- suppressWarnings( cbind( dr_op(x, c("commonNameList.commonNames", "commonNameList.class", "commonNameList.tsn", "class")), tmp ) ) tibble::as_data_frame(x) } ritis/R/core_metadata.R0000644000176200001440000000104613162615006014521 0ustar liggesusers#' Get core metadata from tsn #' #' @export #' @template tsn #' @inheritParams accepted_names #' @examples \dontrun{ #' # coverage and currrency data #' core_metadata(tsn=28727) #' core_metadata(tsn=28727, wt = "xml") #' # no coverage or currrency data #' core_metadata(183671) #' core_metadata(183671, wt = "xml") #' } core_metadata <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getCoreMetadataFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) dr_op(tibble::as_data_frame(parse_raw(out)), "class") } ritis/R/currency.R0000644000176200001440000000110713162615006013561 0ustar liggesusers#' Get currency from tsn #' #' @export #' @template tsn #' @inheritParams accepted_names #' @return a data.frame #' @examples \dontrun{ #' # currency data #' currency(tsn=28727) #' currency(tsn=28727, wt = "xml") #' # no currency dat #' currency(526852) #' currency(526852, raw = TRUE) #' } currency <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getCurrencyFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) res <- parse_raw(out) if (is.null(res$taxonCurrency)) res$taxonCurrency <- "" dr_op(tibble::as_data_frame(res), "class") } ritis/R/last_change_date.R0000644000176200001440000000063213162615564015207 0ustar liggesusers#' Provides the date the ITIS database was last updated #' #' @export #' @inheritParams accepted_names #' @return character value with a date #' @examples \dontrun{ #' last_change_date() #' last_change_date(wt = "xml") #' } last_change_date <- function(wt = "json", raw = FALSE, ...) { out <- itis_GET("getLastChangeDate", list(), wt, ...) if (raw || wt == "xml") return(out) parse_raw(out)$updateDate } ritis/R/solr.R0000644000176200001440000000065513174275672012733 0ustar liggesusers#' ITIS Solr Methods #' #' ITIS provides access to their data via their Solr service described at #' . This is a powerful #' interace to ITIS data as you have access to a very flexible query #' interface. #' #' @section Functions: #' #' - [itis_search()] - Search #' - [itis_group()] - Group #' - [itis_highlight()] - Highlight #' - [itis_facet()] - Facet #' #' @name solr NULL ritis/R/search_common.R0000644000176200001440000000273213162615006014551 0ustar liggesusers#' Search for tsn by common name #' #' @export #' @param x text or taxonomic serial number (TSN) (character or numeric) #' @param from (character) One of "all", "begin", or "end". See Details. #' @inheritParams accepted_names #' @details The `from` parameter: #' \itemize{ #' \item all - Search against the `searchByCommonName` API route, which #' searches entire name string #' \item begin - Search against the `searchByCommonNameBeginsWith` API #' route, which searches for a match at the beginning of a name string #' \item end - Search against the `searchByCommonNameEndsWith` API route, #' which searches for a match at the end of a name string #' } #' @return a data.frame #' @seealso [search_scientific()] #' @examples \dontrun{ #' search_common("american bullfrog") #' search_common("ferret-badger") #' search_common("polar bear") #' #' # comparison: all, begin, end #' search_common("inch") #' search_common("inch", from = "begin") #' search_common("inch", from = "end") #' #' # end #' search_common("snake", from = "end") #' } search_common <- function(x, from = "all", wt = "json", raw = FALSE, ...) { verb <- switch(from, all = "searchByCommonName", begin = "searchByCommonNameBeginsWith", end = "searchByCommonNameEndsWith") out <- itis_GET(endpt = verb, args = list(srchKey = x), wt, ...) if (raw || wt == "xml") return(out) tibble::as_data_frame(dr_op(parse_raw(out)$commonNames, "class")) } ritis/R/accepted_names.R0000644000176200001440000000172413162615135014672 0ustar liggesusers#' Get accepted names from tsn #' #' @export #' @param wt (character) One of "json" or "xml". Required. #' @param raw (logical) Return raw JSON or XML as character string. Required. #' Default: `FALSE` #' @param ... curl options passed on to [crul::HttpClient] #' @template tsn #' @return Zero row data.frame if the name is accepted, otherwise a data.frame #' with information on the currently accepted name #' @examples \dontrun{ #' # TSN accepted - good name #' accepted_names(tsn = 208527) #' #' # TSN not accepted - input TSN is old name #' accepted_names(tsn = 504239) #' #' # raw json #' accepted_names(tsn = 208527, raw = TRUE) #' } accepted_names <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getAcceptedNamesFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) tmp <- parse_raw(out) if (all(is.na(tmp$acceptedNames))) { tibble::data_frame() } else { dr_op(tibble::as_data_frame(tmp$acceptedNames), "class") } } ritis/R/comment_detail.R0000644000176200001440000000073213162615006014716 0ustar liggesusers#' Get comment detail from TSN #' #' @export #' @template tsn #' @inheritParams accepted_names #' @return A data.frame with results. #' @examples \dontrun{ #' comment_detail(tsn=180543) #' comment_detail(tsn=180543, wt = "xml") #' } comment_detail <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getCommentDetailFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) dr_op(tibble::as_data_frame(parse_raw(out)$comments), "class") } ritis/R/rank_name.R0000644000176200001440000000111213162615670013665 0ustar liggesusers#' Returns the kingdom and rank information for the TSN. #' #' @export #' @inheritParams accepted_names #' @template tsn #' @return a data.frame, with rank name and other info #' @examples \dontrun{ #' rank_name(tsn = 202385) #' } rank_name <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getTaxonomicRankNameFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) x <- parse_raw(out) res <- tc(pick_cols(x, c("kingdomId","kingdomName","rankId","rankName","tsn"))) tibble::as_data_frame( if (length(names(res)) == 1) NULL else res ) } ritis/R/vernacular_languages.R0000644000176200001440000000064513162615623016132 0ustar liggesusers#' Provides a list of the unique languages used in the vernacular table. #' #' @export #' @inheritParams accepted_names #' @return a character vector of verncular names #' @examples \dontrun{ #' vernacular_languages() #' } vernacular_languages <- function(wt = "json", raw = FALSE, ...) { out <- itis_GET("getVernacularLanguages", list(), wt, ...) if (raw || wt == "xml") return(out) parse_raw(out)$languageNames } ritis/R/any_match_count.R0000644000176200001440000000111213162615006015076 0ustar liggesusers#' Get any match count. #' #' @export #' @param x text or taxonomic serial number (TSN) (character or numeric) #' @inheritParams accepted_names #' @return An integer containing the number of matches the search will return. #' @examples \dontrun{ #' any_match_count(x = 202385) #' any_match_count(x = "dolphin") #' any_match_count(x = "dolphin", wt = "xml") #' } any_match_count <- function(x, wt = "json", raw = FALSE, ...) { out <- itis_GET("getAnyMatchCount", list(srchKey = x), wt = wt, ...) if (raw || wt == "xml") return(out) if (!nzchar(out)) 0 else parse_raw(out)$return } ritis/R/common_names.R0000644000176200001440000000070513162615006014405 0ustar liggesusers#' Get common names from tsn #' #' @export #' @template tsn #' @inheritParams accepted_names #' @return a data.frame #' @examples \dontrun{ #' common_names(tsn=183833) #' common_names(tsn=183833, wt = "xml") #' } common_names <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getCommonNamesFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) dr_op(tibble::as_data_frame(parse_raw(out)$commonNames), "class") } ritis/R/taxon_authorship.R0000644000176200001440000000105013162615637015335 0ustar liggesusers#' Returns the author information for the TSN. #' #' @export #' @inheritParams accepted_names #' @template tsn #' @return a data.frame #' @examples \dontrun{ #' taxon_authorship(tsn = 183671) #' } taxon_authorship <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getTaxonAuthorshipFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) x <- parse_raw(out) if (is.null(x$authorship) || inherits(x$authorship, "logical")) { tibble::data_frame() } else { dr_op(tibble::as_data_frame(x), "class") } } ritis/R/other_sources.R0000644000176200001440000000150413162615572014624 0ustar liggesusers#' Returns a list of the other sources used for the TSN. #' #' @export #' @inheritParams accepted_names #' @template tsn #' @examples \dontrun{ #' other_sources(tsn=182662) #' other_sources(tsn=182662, wt = "xml") #' } other_sources <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getOtherSourcesFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) x <- parse_raw(out)$otherSources if (inherits(x, "logical") || is.null(x)) { tibble::data_frame() } else { x <- cbind(dr_op(x, "referencefor"), bindlist(x$referenceFor)) tibble::as_data_frame(pick_cols( x, c("acquisitiondate","name","referredtsn","source", "sourcetype","updatedate","version") )) } } bindlist <- function(x) { (data.table::setDF(data.table::rbindlist(x, use.names = TRUE, fill = TRUE))) } ritis/R/rank_names.R0000644000176200001440000000111713162615662014056 0ustar liggesusers#' Provides a list of all the unique rank names contained in the database and #' their kingdom and rank ID values. #' #' @export #' @inheritParams accepted_names #' @return a data.frame, with columns: #' \itemize{ #' \item kingdomname #' \item rankid #' \item rankname #' } #' @examples \dontrun{ #' rank_names() #' } rank_names <- function(wt = "json", raw = FALSE, ...) { out <- itis_GET("getRankNames", list(), wt, ...) if (raw || wt == "xml") return(out) x <- parse_raw(out)$rankNames tibble::as_data_frame(pick_cols( x, c("kingdomName", "rankId", "rankName") )) } ritis/R/global_species_completeness.R0000644000176200001440000000121513162615006017463 0ustar liggesusers#' Get global species completeness from tsn #' #' @export #' @inheritParams accepted_names #' @template tsn #' @examples \dontrun{ #' global_species_completeness(tsn = 180541) #' global_species_completeness(180541, wt = "xml") #' global_species_completeness(180541, wt = "json", raw = TRUE) #' } global_species_completeness <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getGlobalSpeciesCompletenessFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) tibble::as_data_frame( tc(pick_cols(parse_raw(out), c("completeness","rankId","tsn"))) ) } ritis/R/usage.R0000644000176200001440000000111213162615625013036 0ustar liggesusers#' Returns the usage information for the TSN. #' #' @export #' @inheritParams accepted_names #' @template tsn #' @examples \dontrun{ #' usage(tsn = 526852) #' usage(tsn = 526852, raw = TRUE) #' usage(tsn = 526852, wt = "xml") #' } usage <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getTaxonomicUsageFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) x <- parse_raw(out) if (is.null(x$taxonUsageRating) || inherits(x$taxonUsageRating, "logical")) { tibble::data_frame() } else { dr_op(tibble::as_data_frame(x), "class") } } ritis/R/date_data.R0000644000176200001440000000107713162615006013643 0ustar liggesusers#' Get date data from tsn #' #' @export #' @template tsn #' @inheritParams accepted_names #' @examples \dontrun{ #' date_data(tsn = 180543) #' date_data(180543, wt = "xml") #' date_data(180543, wt = "json", raw = TRUE) #' } date_data <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getDateDataFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) res <- parse_raw(out) if (is.null(res$initialTimeStamp)) res$initialTimeStamp <- "" if (is.null(res$updateDate)) res$updateDate <- "" dr_op(tibble::as_data_frame(res), "class") } ritis/R/search_anymatch.R0000644000176200001440000000142713162615650015072 0ustar liggesusers#' Search for any match #' #' @export #' @inheritParams accepted_names #' @inheritParams any_match_count #' @return a data.frame #' @seealso \code{\link{search_any_match_paged}} #' @examples \dontrun{ #' search_anymatch(x = 202385) #' search_anymatch(x = "dolphin") #' } search_anymatch <- function(x, wt = "json", raw = FALSE, ...) { out <- itis_GET("searchForAnyMatch", list(srchKey = x), wt, ...) if (raw || wt == "xml") return(out) x <- parse_raw(out)$anyMatchList tmp <- dr_op(bindlist(x$commonNameList.commonNames), "class") names(tmp) <- paste0("common_", names(tmp)) x <- suppressWarnings( cbind( dr_op(x, c("commonNameList.commonNames", "commonNameList.class", "commonNameList.tsn", "class")), tmp ) ) tibble::as_data_frame(x) } ritis/R/scientific_name.R0000644000176200001440000000122513162615654015061 0ustar liggesusers#' Returns the scientific name for the TSN. Also returns the component parts #' (names and indicators) of the scientific name. #' #' @export #' @inheritParams accepted_names #' @template tsn #' @return a data.frame #' @examples \dontrun{ #' scientific_name(tsn = 531894) #' } scientific_name <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getScientificNameFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) x <- tc(parse_raw(out)) tibble::as_data_frame(pick_cols( data.frame(x, stringsAsFactors = FALSE), c("combinedName","unitInd1","unitInd3","unitName1","unitName2", "unitName3","tsn") )) } ritis/R/parent_tsn.R0000644000176200001440000000111213162615664014112 0ustar liggesusers#' Returns the parent TSN for the entered TSN. #' #' @export #' @inheritParams accepted_names #' @template tsn #' @return a data.frame #' @examples \dontrun{ #' parent_tsn(tsn = 202385) #' parent_tsn(tsn = 202385, raw = TRUE) #' parent_tsn(tsn = 202385, wt = "xml") #' } parent_tsn <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getParentTSNFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) x <- parse_raw(out) res <- tc(pick_cols(x, c("parentTsn", "tsn"))) tibble::as_data_frame( if (length(names(res)) == 1) NULL else res ) } ritis/R/kingdoms.R0000644000176200001440000000171013162615562013551 0ustar liggesusers#' Get kingdom names from tsn #' #' @export #' @name kingdoms #' @inheritParams accepted_names #' @template tsn #' @details #' \itemize{ #' \item kingdom_name: Get kingdom name for a TSN #' \item kingdom_names: Get all possible kingdom names #' } #' @examples \dontrun{ #' kingdom_name(202385) #' kingdom_name(202385, wt = "xml") #' kingdom_names() #' } kingdom_name <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getKingdomNameFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) res <- tc(pick_cols(parse_raw(out), c('kingdomid', 'kingdomname', 'tsn'))) tibble::as_data_frame( if (length(names(res)) != 1) res else NULL ) } #' @export #' @rdname kingdoms kingdom_names <- function(wt = "json", raw = FALSE, ...) { out <- itis_GET("getKingdomNames", list(), wt, ...) if (raw || wt == "xml") return(out) pick_cols(tibble::as_data_frame(parse_raw(out)$kingdomNames), c('kingdomid', 'kingdomname', 'tsn')) } ritis/R/tsn_by_vernacular_language.R0000644000176200001440000000132213162615631017315 0ustar liggesusers#' Get tsn by vernacular language #' #' @export #' @inheritParams accepted_names #' @param language A string containing the language. This is a language string, #' not the international language code (character) #' @return a data.frame #' @examples \dontrun{ #' tsn_by_vernacular_language(language = "french") #' } tsn_by_vernacular_language <- function(language, wt = "json", raw = FALSE, ...) { out <- itis_GET("getTsnByVernacularLanguage", list(language = language), wt, ...) if (raw || wt == "xml") return(out) x <- parse_raw(out) if (is.null(x$vernacularTsns) || inherits(x$vernacularTsns, "logical")) { tibble::data_frame() } else { dr_op(tibble::as_data_frame(x$vernacularTsns), "class") } } ritis/R/coverage.R0000644000176200001440000000101413162615006013517 0ustar liggesusers#' Get coverge from tsn #' #' @export #' @template tsn #' @inheritParams accepted_names #' @examples \dontrun{ #' # coverage data #' coverage(tsn=28727) #' # no coverage data #' coverage(526852) #' coverage(526852, wt = "xml") #' } coverage <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getCoverageFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) res <- parse_raw(out) if (is.null(res$taxonCoverage)) res$taxonCoverage <- "" dr_op(tibble::as_data_frame(res), "class") } ritis/R/description.R0000644000176200001440000000060713162615006014256 0ustar liggesusers#' Get description of the ITIS service #' #' @export #' @inheritParams accepted_names #' @return a string, the ITIS web service description #' @examples \dontrun{ #' description() #' description(wt = "xml") #' } description <- function(wt = "json", raw = FALSE, ...) { out <- itis_GET("getDescription", list(), wt, ...) if (raw || wt == "xml") return(out) parse_raw(out)$description } ritis/R/jurisdiction.R0000644000176200001440000000316313162615556014453 0ustar liggesusers#' Get jurisdictional origin from tsn #' #' @export #' @name jurisdiction #' @inheritParams accepted_names #' @template tsn #' @return #' \itemize{ #' \item jurisdictional_origin: data.frame #' \item jurisdiction_origin_values: data.frame #' \item jurisdiction_values: character vector #' } #' @details Jurisdiction methods: #' \itemize{ #' \item jurisdictional_origin: Get jurisdictional origin from tsn #' \item jurisdiction_origin_values: Get jurisdiction origin values #' \item jurisdiction_values: Get all possible jurisdiction values #' } #' @examples \dontrun{ #' jurisdictional_origin(tsn=180543) #' jurisdictional_origin(tsn=180543, wt = "xml") #' #' jurisdiction_origin_values() #' #' jurisdiction_values() #' } jurisdictional_origin <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getJurisdictionalOriginFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) z <- parse_raw(out) tibble::as_data_frame( pick_cols(z$jurisdictionalOrigins, c("jurisdictionValue", "origin", "updateDate")) ) } #' @export #' @rdname jurisdiction jurisdiction_origin_values <- function(wt = "json", raw = FALSE, ...) { out <- itis_GET("getJurisdictionalOriginValues", list(), wt, ...) if (raw || wt == "xml") return(out) tibble::as_data_frame( pick_cols(parse_raw(out)$originValues, c("jurisdiction", "origin")) ) } #' @export #' @rdname jurisdiction jurisdiction_values <- function(wt = "json", raw = FALSE, ...) { out <- itis_GET("getJurisdictionValues", list(), wt, ...) if (raw || wt == "xml") return(out) parse_raw(out)$jurisdictionValues } ritis/R/ritis-package.R0000644000176200001440000000201712732402574014461 0ustar liggesusers#' Interface to Integrated Taxonomic Information (ITIS) #' #' @section ritis package API: #' All functions that start with \code{itis_} work with the ITIS Solr #' API described at \url{http://www.itis.gov/solr_documentation.html}, #' which uses the package \pkg{solrium}, and these functions have you #' use the \pkg{solrium} function interfaces, so you can pass on parameters #' to the \pkg{solrium} functions - so the \pkg{solrium} docs are important #' here. #' #' All other functions work with the ITIS REST API described at #' \url{http://www.itis.gov/ws_description.html}. For these methods, #' they can grab data in either JSON or XML format. JSON is the default. #' We parse the JSON to R native format, either data.frame, character #' string, or list. You can get raw JSON as a character string back, #' or raw XML as a character string, and then parse yourself with #' \pkg{jsonlite} or \pkg{xml2} #' #' @name ritis-package #' @aliases ritis #' @docType package #' @author Scott Chamberlain \email{myrmecocystus@@gmail.com} NULL ritis/R/credibility.R0000644000176200001440000000213513162615006014234 0ustar liggesusers#' Get credibility rating from tsn #' #' @export #' @name credibility #' @template tsn #' @inheritParams accepted_names #' @return a data.frame #' @details methods: #' \itemize{ #' \item credibility_rating: Get credibility rating for a tsn #' \item credibility_ratings: Get possible credibility ratings #' } #' @examples \dontrun{ #' credibility_rating(tsn = 526852) #' credibility_rating(526852, wt = "xml") #' credibility_rating(526852, raw = TRUE) #' #' credibility_ratings() #' credibility_ratings(wt = "xml") #' credibility_ratings(raw = TRUE) #' } credibility_rating <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getCredibilityRatingFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) res <- parse_raw(out) if (is.null(res$credRating)) res$credRating <- "" dr_op(tibble::as_data_frame(res), "class") } #' @export #' @rdname credibility credibility_ratings <- function(wt = "json", raw = FALSE, ...) { out <- itis_GET("getCredibilityRatings", list(), wt, ...) if (raw || wt == "xml") return(out) dr_op(tibble::as_data_frame(parse_raw(out)), "class") } ritis/R/search_scientific.R0000644000176200001440000000103113162615642015376 0ustar liggesusers#' Search by scientific name #' #' @export #' @inheritParams accepted_names #' @inheritParams any_match_count #' @return a data.frame #' @seealso \code{\link{search_common}} #' @examples \dontrun{ #' search_scientific("Tardigrada") #' search_scientific("Quercus douglasii") #' } search_scientific <- function(x, wt = "json", raw = FALSE, ...) { out <- itis_GET("searchByScientificName", list(srchKey = x), wt, ...) if (raw || wt == "xml") return(out) tibble::as_data_frame( dr_op(parse_raw(out)$scientificNames, "class") ) } ritis/R/itis_search.R0000644000176200001440000000301513174402425014226 0ustar liggesusers#' ITIS Solr search #' #' @export #' @param ... Arguments passed on to the `params` parameter of #' the [solrium::solr_search()] function #' @param proxy List of arguments for a proxy connection, #' including one or more of: url, port, username, password, #' and auth. See [crul::proxy()] for help, which is used to #' construct the proxy connection. #' @param callopts Curl options passed on to [crul::HttpClient] #' @examples \dontrun{ #' itis_search(q = "tsn:182662") #' #' itis_search(q = "nameWOInd:Liquidamber\\%20styraciflua~0.4") #' # matches only monomials #' itis_search(q = "nameWOInd:/[A-Za-z0-9]*[%20]{0,0}*/") #' # matches only binomials #' itis_search(q = "nameWOInd:/[A-Za-z0-9]*[%20]{1,1}[A-Za-z0-9]*/") #' # matches only trinomials #' itis_search(q = "nameWOInd:/[A-Za-z0-9]*[%20]{1,1}[A-Za-z0-9]*[%20]{1,1}[A-Za-z0-9]*/") #' # matches binomials or trinomials #' itis_search(q = "nameWOInd:/[A-Za-z0-9]*[%20]{1,1}[A-Za-z0-9]*[%20]{0,1}[A-Za-z0-9]*/") #' #' itis_search(q = "nameWOInd:Poa\\%20annua") #' #' itis_search(q = "nameWOInd:/[A-Za-z0-9]*[%20]{0,0}*/", rows = 2) #' itis_search(q = "nameWOInd:/[A-Za-z0-9]*[%20]{0,0}*/", rows = 200) #' #' itis_search(q = "nameWOInd:/[A-Za-z0-9]*[%20]{0,0}*/", #' fl = c('nameWInd', 'tsn')) #' } itis_search <- function(..., proxy = NULL, callopts=list()) { if (!is.null(proxy)) conn_dc <- make_itis_conn(proxy) args <- list(...) if (!is.null(args$fl)) args$fl <- paste(args$fl, collapse = ",") conn_itis$search(params = args, minOptimizedRows = FALSE, callopts = callopts) } ritis/R/unacceptability_reason.R0000644000176200001440000000106713162615627016474 0ustar liggesusers#' Returns the unacceptability reason, if any, for the TSN. #' #' @export #' @inheritParams accepted_names #' @template tsn #' @examples \dontrun{ #' unacceptability_reason(tsn = 183671) #' } unacceptability_reason <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getUnacceptabilityReasonFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) x <- parse_raw(out) if (is.null(x$unacceptReason) || inherits(x$unacceptReason, "logical")) { tibble::data_frame() } else { dr_op(tibble::as_data_frame(x), "class") } } ritis/R/terms.R0000644000176200001440000000451613162615635013100 0ustar liggesusers#' Get ITIS terms, i.e., tsn's, authors, common names, and scientific names. #' #' @export #' @inheritParams accepted_names #' @param query One or more common or scientific names, or partial names #' @param what One of both (search common and scientific names), common #' (search just common names), or scientific (search just scientific names) #' @examples \dontrun{ #' # Get terms searching both common and scientific names #' terms(query='bear') #' #' # Get terms searching just common names #' terms(query='tarweed', "common") #' #' # Get terms searching just scientific names #' terms(query='Poa annua', "scientific") #' #' # many at once #' terms(query=c('Poa annua', 'Pinus contorta'), "scientific") #' } terms <- function(query, what = "both", wt = "json", raw = FALSE, ...) { what <- match.arg(what, c('both', 'scientific', 'common')) temp <- switch(what, both = lapply(query, function(x) itisterms(x, wt, raw, ...)), common = lapply(query, function(x) itistermsfromcommonname(x, wt, raw, ...)), scientific = lapply(query, function(x) itistermsfromscientificname(x, wt, raw, ...))) if (length(query) == 1) { temp[[1]] } else { stats::setNames(temp, query) } } # helpers itisterms <- function(x, wt = "json", raw = FALSE, ...) { out <- itis_GET("getITISTerms", list(srchKey = x), wt, ...) if (raw || wt == "xml") return(out) x <- parse_raw(out) if (is.null(x$itisTerms) || inherits(x$itisTerms, "logical")) { tibble::data_frame() } else { dr_op(tibble::as_data_frame(x$itisTerms), "class") } } itistermsfromcommonname <- function(x, wt = "json", raw = FALSE, ...) { out <- itis_GET("getITISTermsFromCommonName", list(srchKey = x), wt, ...) if (raw || wt == "xml") return(out) x <- parse_raw(out) if (is.null(x$itisTerms) || inherits(x$itisTerms, "logical")) { tibble::data_frame() } else { dr_op(tibble::as_data_frame(x$itisTerms), "class") } } itistermsfromscientificname <- function(x, wt = "json", raw = FALSE, ...) { out <- itis_GET("getITISTermsFromScientificName", list(srchKey = x), wt, ...) if (raw || wt == "xml") return(out) x <- parse_raw(out) if (is.null(x$itisTerms) || inherits(x$itisTerms, "logical")) { tibble::data_frame() } else { dr_op(tibble::as_data_frame(x$itisTerms), "class") } } ritis/R/review_year.R0000644000176200001440000000072013162615656014263 0ustar liggesusers#' Returns the review year for the TSN. #' #' @export #' @inheritParams accepted_names #' @template tsn #' @return a data.frame #' @examples \dontrun{ #' review_year(tsn = 180541) #' } review_year <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getReviewYearFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) x <- tc(parse_raw(out)) tibble::as_data_frame( tc(pick_cols(x, c("rankId","reviewYear","tsn"))) ) } ritis/R/tsn2lsid.R0000644000176200001440000000103413162615633013476 0ustar liggesusers#' Gets the unique LSID for the TSN, or an empty result if there is no match. #' #' @export #' @inheritParams accepted_names #' @template tsn #' @return a character string, an LSID, or \code{NULL} if nothing found #' @examples \dontrun{ #' tsn2lsid(tsn = 155166) #' tsn2lsid(tsn = 333333333) #' tsn2lsid(155166, raw = TRUE) #' tsn2lsid(155166, wt = "xml") #' } tsn2lsid <- function(tsn, wt = "json", raw = FALSE, ...) { x <- itis_GET("getLSIDFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(x) parse_raw(x)$return } ritis/R/hierarchy.R0000644000176200001440000000351713162615006013714 0ustar liggesusers#' Get hierarchy down from tsn #' #' @export #' @name hierarchy #' @inheritParams accepted_names #' @template tsn #' @details Hierarchy methods: #' \itemize{ #' \item hierarchy_down: Get hierarchy down from tsn #' \item hierarchy_up: Get hierarchy up from tsn #' \item hierarchy_full: Get full hierarchy from tsn #' } #' @examples \dontrun{ #' ## Full down (class Mammalia) #' hierarchy_down(tsn=179913) #' #' ## Full up (genus Agoseris) #' hierarchy_up(tsn=36485) #' #' ## Full hierarchy #' ### genus Liatris #' hierarchy_full(tsn=37906) #' ### get raw data back #' hierarchy_full(tsn=37906, raw = TRUE) #' ### genus Baetis, get xml back #' hierarchy_full(100800, wt = "xml") #' } hierarchy_down <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getHierarchyDownFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) tibble::as_data_frame( pick_cols(parse_raw(out)$hierarchyList, c("parentName","parentTsn", "rankName","taxonName","tsn")) ) } #' @export #' @rdname hierarchy hierarchy_up <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getHierarchyUpFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) res <- tc(pick_cols(parse_raw(out), c("parentName","parentTsn","rankName", "taxonName","tsn"))) tibble::as_data_frame( if (length(names(res)) != 1) res else NULL ) } #' @export #' @rdname hierarchy hierarchy_full <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getFullHierarchyFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) x <- parse_raw(out) tibble::as_data_frame( pick_cols( if ('hierarchyList' %in% names(x)) x$hierarchyList else x, c('parentname', 'parenttsn', 'rankname', 'taxonname', 'tsn') ) ) } ritis/R/geographic_values.R0000644000176200001440000000071213162615006015417 0ustar liggesusers#' Get all possible geographic values #' #' @export #' @inheritParams accepted_names #' @return character vector of geographic names #' @examples \dontrun{ #' geographic_values() #' geographic_values(wt = "xml") #' geographic_values(wt = "json", raw = TRUE) #' } geographic_values <- function(wt = "json", raw = FALSE, ...) { out <- itis_GET("getGeographicValues", list(), wt, ...) if (raw || wt == "xml") return(out) parse_raw(out)$geographicValues } ritis/R/publications.R0000644000176200001440000000146413162615666014445 0ustar liggesusers#' Returns a list of the pulications used for the TSN. #' #' @export #' @inheritParams accepted_names #' @template tsn #' @return a data.frame #' @examples \dontrun{ #' publications(tsn = 70340) #' publications(tsn = 70340, wt = "xml") #' #' publications(tsn = 70340, verbose = TRUE) #' } publications <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getPublicationsFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) x <- parse_raw(out)$publications x <- cbind(dr_op(x, "referencefor"), dr_op(bindlist(x$referenceFor), "class")) tibble::as_data_frame(pick_cols( x, c("actualPubDate","isbn","issn","listedPubDate","pages", "pubComment","pubName","pubPlace","publisher","referenceAuthor", "name","refLanguage","referredTsn","title","updateDate") )) } ritis/R/geographic_divisions.R0000644000176200001440000000124213162615006016126 0ustar liggesusers#' Get geographic divisions from tsn #' #' @export #' @template tsn #' @inheritParams accepted_names #' @examples \dontrun{ #' geographic_divisions(tsn = 180543) #' #' geographic_divisions(tsn = 180543, wt = "xml") #' #' geographic_divisions(tsn = 180543, wt = "json", raw = TRUE) #' } geographic_divisions <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getGeographicDivisionsFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) res <- parse_raw(out) if (inherits(res$geoDivisions, "logical") || is.null(res$geoDivisions)) { tibble::data_frame() } else { dr_op(tibble::as_data_frame(res$geoDivisions), "class") } } ritis/R/itis_highlight.R0000644000176200001440000000102413174402452014726 0ustar liggesusers#' ITIS Solr highlight #' #' @export #' @param ... Arguments passed on to the `params` parameter of #' the [solrium::solr_highlight()] function #' @inheritParams itis_search #' @examples \dontrun{ #' itis_highlight(q = "rank:Species", hl.fl = 'rank', rows=10) #' } itis_highlight <- function(..., proxy = NULL, callopts=list()) { if (!is.null(proxy)) conn_dc <- make_itis_conn(proxy) args <- list(...) if (!is.null(args$fl)) args$fl <- paste(args$fl, collapse = ",") conn_itis$highlight(params = args, callopts = callopts) } ritis/R/itis_facet.R0000644000176200001440000000137313174402440014045 0ustar liggesusers#' ITIS Solr facet #' #' @export #' @param ... Arguments passed on to the `params` parameter of #' the [solrium::solr_facet()] function #' @inheritParams itis_search #' @examples \dontrun{ #' itis_facet(q = "rank:Species", rows = 0, facet.field = "kingdom")$facet_fields #' #' x <- itis_facet(q = "hierarchySoFar:*$Aves$* AND rank:Species AND usage:valid", #' facet.pivot = "nameWInd,vernacular", facet.limit = -1, facet.mincount = 1, #' rows = 0) #' head(x$facet_pivot$`nameWInd,vernacular`) #' } itis_facet <- function(..., proxy = NULL, callopts=list()) { if (!is.null(proxy)) conn_dc <- make_itis_conn(proxy) args <- list(...) if (!is.null(args$fl)) args$fl <- paste(args$fl, collapse = ",") conn_itis$facet(params = args, callopts = callopts) } ritis/R/lsid2tsn.R0000644000176200001440000000116613162615567013512 0ustar liggesusers#' Gets the TSN corresponding to the LSID, or an empty result if there is no match. #' #' @export #' @inheritParams accepted_names #' @param lsid (character) lsid for a taxonomic group. Required. #' @examples \dontrun{ #' lsid2tsn(lsid="urn:lsid:itis.gov:itis_tsn:28726") #' lsid2tsn(lsid="urn:lsid:itis.gov:itis_tsn:28726", wt = "xml") #' lsid2tsn("urn:lsid:itis.gov:itis_tsn:0") #' lsid2tsn("urn:lsid:itis.gov:itis_tsn:0", wt = "xml") #' } lsid2tsn <- function(lsid, wt = "json", raw = FALSE, ...) { out <- itis_GET("getTSNFromLSID", list(lsid = lsid), wt, ...) if (raw || wt == "xml") return(out) parse_raw(out)$return } ritis/R/experts.R0000644000176200001440000000067513162562215013435 0ustar liggesusers#' Get expert information for the TSN. #' #' @export #' @inheritParams accepted_names #' @template tsn #' @examples \dontrun{ #' experts(tsn = 180544) #' experts(180544, wt = "xml") #' experts(180544, raw = TRUE) #' } experts <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getExpertsFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) dr_op(tibble::as_data_frame(parse_raw(out)$experts), "class") } ritis/R/zzz.R0000644000176200001440000000440213174374021012567 0ustar liggesuserstc <- function(l) Filter(Negate(is.null), l) argsnull <- function(x) { if (length(x) == 0) { NULL } else { x } } nmslwr <- function(x) { stats::setNames(x, tolower(names(x))) } itbase <- function() 'https://www.itis.gov/ITISWebService/services/ITISService/' itjson <- function() 'https://www.itis.gov/ITISWebService/jsonservice/' itis_solr_url <- function() "https://services.itis.gov" iturl <- function(x) { if (!tolower(x) %in% c('json', 'xml')) { stop("'wt' must be one of 'json' or 'xml'", call. = FALSE) } switch( x, json = itjson(), xml = itbase() ) } `%-%` <- function(x, y) if (length(x) == 0 || nchar(x) == 0 || is.null(x)) y else x dr_op <- function(x, y) { UseMethod("dr_op") } dr_op.default <- function(x, y) { return(NULL) } dr_op.data.frame <- function(x, y) { x[, !tolower(names(x)) %in% tolower(y)] } dr_op.list <- function(x, y) { x[!tolower(names(x)) %in% tolower(y)] } itis_GET <- function(endpt, args, wt, ...){ args <- argsnull(args) cli <- crul::HttpClient$new( url = paste0(iturl(wt), endpt), opts = list(...) ) tt <- cli$get(query = args) tt$raise_for_status() # sort out encoding - if not found, parse differently encoding <- NULL if (!is.null(tt$response_headers$`content-type`)) { encoding <- strsplit( strsplit(tt$response_headers$`content-type`, ";")[[1]][2], "=" )[[1]][2] } if (is.null(encoding) || !nzchar(encoding)) { readBin(tt$content, character()) } else { tt$parse(encoding) } } parse_raw <- function(x) { if ((inherits(x, "character") && !nzchar(x)) || is.na(x)) { return(tibble::as_data_frame()) } jsonlite::fromJSON(x, flatten = TRUE) } pick_cols <- function(x, nms) { UseMethod("pick_cols") } pick_cols.default <- function(x, nms) { return(NULL) } pick_cols.data.frame <- function(x, nms) { if (NROW(x) > 0) { names(x) <- tolower(names(x)) x[, names(x) %in% tolower(nms)] } else { NULL } } pick_cols.list <- function(x, nms) { if (NROW(x) > 0) { names(x) <- tolower(names(x)) x[names(x) %in% tolower(nms)] } else { NULL } } make_itis_conn <- function(proxy) { solrium::SolrClient$new(host = "services.itis.gov", scheme = "https", port = NULL, errors = "complete", proxy = proxy) } ritis/R/itis_group.R0000644000176200001440000000111613174402445014117 0ustar liggesusers#' ITIS Solr group search #' #' @export #' @param ... Arguments passed on to the `params` parameter of #' the [solrium::solr_group()] function #' @inheritParams itis_search #' @examples \dontrun{ #' x <- itis_group(q = "nameWOInd:/[A-Za-z0-9]*[%20]{1,1}[A-Za-z0-9]*/", #' group.field = 'rank', group.limit = 3) #' head(x) #' } itis_group <- function(..., proxy = NULL, callopts=list()) { if (!is.null(proxy)) conn_dc <- make_itis_conn(proxy) args <- list(...) if (!is.null(args$fl)) args$fl <- paste(args$fl, collapse = ",") conn_itis$group(params = args, callopts = callopts) } ritis/R/record.R0000644000176200001440000000175713162615660013226 0ustar liggesusers#' Gets a record from an LSID #' #' @export #' @inheritParams accepted_names #' @param lsid lsid for a taxonomic group (character). Required. #' @details Gets the partial ITIS record for the TSN in the LSID, found by comparing the #' TSN in the search key to the TSN field. Returns an empty result set if #' there is no match or the TSN is invalid. #' @return a data.frame #' @examples \dontrun{ #' record(lsid = "urn:lsid:itis.gov:itis_tsn:180543") #' } record <- function(lsid, wt = "json", raw = FALSE, ...) { out <- itis_GET("getRecordFromLSID", list(lsid = lsid), wt, ...) if (raw || wt == "xml") return(out) x <- tc(parse_raw(out)) tibble::as_data_frame( if (length(names(x)) < 2) { NULL } else { pick_cols( data.frame(x, stringsAsFactors = FALSE), c("authorship","genusPart","infragenericEpithet", "infraspecificEpithet","lsid","nameComplete","nomenclaturalCode", "rank","rankString","specificEpithet","uninomial","tsn")) } ) } ritis/R/full_record.R0000644000176200001440000000172713162615006014237 0ustar liggesusers#' Get full record from TSN or lsid #' #' @export #' @param lsid lsid for a taxonomic group (character) #' @inheritParams comment_detail #' @examples \dontrun{ #' # from tsn #' full_record(tsn = 50423) #' full_record(tsn = 202385) #' full_record(tsn = 183833) #' #' full_record(tsn = 183833, wt = "xml") #' full_record(tsn = 183833, raw = TRUE) #' #' # from lsid #' full_record(lsid = "urn:lsid:itis.gov:itis_tsn:180543") #' full_record(lsid = "urn:lsid:itis.gov:itis_tsn:180543") #' } full_record <- function(tsn = NULL, lsid = NULL, wt = "json", raw = FALSE, ...) { if (!xor(is.null(tsn), is.null(lsid))) { stop("Pass only one of `tsn` or `lsid`", call. = FALSE) } if (!is.null(tsn)) { verb <- "getFullRecordFromTSN" args <- list(tsn = tsn) } else { verb <- "getFullRecordFromLSID" args <- list(lsid = lsid) } out <- itis_GET(verb, args, wt, ...) if (raw || wt == "xml") return(out) dr_op(tc(parse_raw(out)), "class") } ritis/R/synonym_names.R0000644000176200001440000000114013162615641014630 0ustar liggesusers#' Returns a list of the synonyms (if any) for the TSN. #' #' @export #' @inheritParams accepted_names #' @template tsn #' @return a data.frame #' @examples \dontrun{ #' synonym_names(tsn=183671) # tsn not accepted #' synonym_names(tsn=526852) # tsn accepted #' } synonym_names <- function(tsn, wt = "json", raw = FALSE, ...) { out <- itis_GET("getSynonymNamesFromTSN", list(tsn = tsn), wt, ...) if (raw || wt == "xml") return(out) tmp <- parse_raw(out)$synonyms if (inherits(tmp, "logical") || is.null(tmp)) { tibble::data_frame() } else { dr_op(tibble::as_data_frame(tmp), "class") } } ritis/vignettes/0000755000176200001440000000000013176715441013425 5ustar liggesusersritis/vignettes/ritis_vignette.Rmd0000644000176200001440000001300612777474350017137 0ustar liggesusers ritis introduction ================== An interface to the Integrated Taxonomic Information System (ITIS) ## Installation Install from CRAN ```r install.packages("ritis") ``` Or install the development version from GitHub ```r devtools::install_github("ropensci/ritis") ``` Load `ritis` ```r library("ritis") ``` ## ITIS Solr interface There are four methods. * `itis_search()` - Search * `itis_group()` - Group * `itis_highlight()` - Hightlight * `itis_facet()` - Facet These four methods use the equivalent functions in the package `solrium`, e.g., `ritis::itis_search()` uses `solrium::solr_search()`, etc. The `itis_*()` functions simply use `...` to allow users to pass on parameters to the wrapped `solrium` functions. So do read the `solrium` docs. ITIS Solr API docs: Some examples: matches only monomials ```r itis_search(q = "nameWOInd:/[A-Za-z0-9]*[%20]{0,0}*/") #> # A tibble: 10 × 27 #> tsn nameWInd nameWOInd unit1 usage #> #> 1 51 Schizomycetes Schizomycetes Schizomycetes invalid #> 2 50 Bacteria Bacteria Bacteria valid #> 3 52 Archangiaceae Archangiaceae Archangiaceae invalid #> 4 53 Pseudomonadales Pseudomonadales Pseudomonadales valid #> 5 54 Rhodobacteriineae Rhodobacteriineae Rhodobacteriineae invalid #> 6 55 Pseudomonadineae Pseudomonadineae Pseudomonadineae invalid #> 7 56 Nitrobacteraceae Nitrobacteraceae Nitrobacteraceae invalid #> 8 57 Nitrobacter Nitrobacter Nitrobacter valid #> 9 65 Nitrosomonas Nitrosomonas Nitrosomonas valid #> 10 70 Thiobacteriaceae Thiobacteriaceae Thiobacteriaceae invalid #> # ... with 22 more variables: unacceptReason , #> # credibilityRating , completenessRating , #> # currencyRating , kingdom , rankID , rank , #> # hierarchySoFar , hierarchySoFarWRanks , hierarchyTSN , #> # synonyms , synonymTSNs , otherSource , #> # acceptedTSN , comment , createDate , updateDate , #> # `_version_` , taxonAuthor , vernacular , #> # hierarchicalSort , parentTSN ``` matches only binomials ```r itis_search(q = "nameWOInd:/[A-Za-z0-9]*[%20]{1,1}[A-Za-z0-9]*/") #> # A tibble: 10 × 25 #> tsn nameWInd nameWOInd unit1 #> #> 1 58 Nitrobacter agilis Nitrobacter agilis Nitrobacter #> 2 59 Nitrobacter flavus Nitrobacter flavus Nitrobacter #> 3 60 Nitrobacter oligotrophis Nitrobacter oligotrophis Nitrobacter #> 4 61 Nitrobacter polytrophus Nitrobacter polytrophus Nitrobacter #> 5 62 Nitrobacter punctata Nitrobacter punctata Nitrobacter #> 6 64 Nitrobacter winogradskyi Nitrobacter winogradskyi Nitrobacter #> 7 66 Nitrosomonas europaea Nitrosomonas europaea Nitrosomonas #> 8 67 Nitrosomonas groningensis Nitrosomonas groningensis Nitrosomonas #> 9 68 Nitrosomonas javenensis Nitrosomonas javenensis Nitrosomonas #> 10 69 Nitrosomonas monocella Nitrosomonas monocella Nitrosomonas #> # ... with 21 more variables: unit2 , usage , #> # unacceptReason , credibilityRating , kingdom , #> # rankID , rank , hierarchySoFar , #> # hierarchySoFarWRanks , hierarchyTSN , synonyms , #> # synonymTSNs , otherSource , acceptedTSN , #> # comment , createDate , updateDate , `_version_` , #> # taxonAuthor , parentTSN , hierarchicalSort ``` ## ITIS REST API interface ITIS REST API docs: The following are some example uses. There are many more methods not shown below ------- Get accepted names for a TSN ```r accepted_names(tsn = 504239) #> # A tibble: 1 × 3 #> acceptedName acceptedTsn author #> #> 1 Dasiphora fruticosa 836659 (L.) Rydb. ``` Get common names for a TSN ```r common_names(tsn = 183833) #> # A tibble: 3 × 3 #> commonName language tsn #> #> 1 African hunting dog English 183833 #> 2 African Wild Dog English 183833 #> 3 Painted Hunting Dog English 183833 ``` Full hierarchy for a TSN ```r hierarchy_full(tsn = 37906) #> # A tibble: 60 × 5 #> parentname parenttsn rankname taxonname tsn #> * #> 1 Kingdom Plantae 202422 #> 2 Plantae 202422 Subkingdom Viridiplantae 954898 #> 3 Viridiplantae 954898 Infrakingdom Streptophyta 846494 #> 4 Streptophyta 846494 Superdivision Embryophyta 954900 #> 5 Embryophyta 954900 Division Tracheophyta 846496 #> 6 Tracheophyta 846496 Subdivision Spermatophytina 846504 #> 7 Spermatophytina 846504 Class Magnoliopsida 18063 #> 8 Magnoliopsida 18063 Superorder Asteranae 846535 #> 9 Asteranae 846535 Order Asterales 35419 #> 10 Asterales 35419 Family Asteraceae 35420 #> # ... with 50 more rows ``` ritis/README.md0000644000176200001440000001337212777474216012712 0ustar liggesusersritis ===== [![Build Status](https://travis-ci.org/ropensci/ritis.svg?branch=master)](https://travis-ci.org/ropensci/ritis) [![Build status](https://ci.appveyor.com/api/projects/status/pvrc9muevha00fie/branch/master?svg=true)](https://ci.appveyor.com/project/sckott/ritis/branch/master) [![codecov](https://codecov.io/gh/ropensci/ritis/branch/master/graph/badge.svg)](https://codecov.io/gh/ropensci/ritis) [![rstudio mirror downloads](http://cranlogs.r-pkg.org/badges/ritis)](https://github.com/metacran/cranlogs.app) [![cran version](http://www.r-pkg.org/badges/version/ritis)](https://cran.r-project.org/package=ritis) * [ITIS API Docs](https://www.itis.gov/ws_description.html) * [Solr service](https://www.itis.gov/solr_documentation.html) ## Installation Stable, CRAN version ```r install.packages("ritis") ``` Dev version ```r devtools::install_github("ropensci/ritis") ``` ```r library("ritis") ``` ## Solr service matches only monomials ```r itis_search(q = "nameWOInd:/[A-Za-z0-9]*[%20]{0,0}*/") #> # A tibble: 10 × 27 #> tsn nameWInd nameWOInd unit1 usage #> #> 1 51 Schizomycetes Schizomycetes Schizomycetes invalid #> 2 50 Bacteria Bacteria Bacteria valid #> 3 52 Archangiaceae Archangiaceae Archangiaceae invalid #> 4 53 Pseudomonadales Pseudomonadales Pseudomonadales valid #> 5 54 Rhodobacteriineae Rhodobacteriineae Rhodobacteriineae invalid #> 6 55 Pseudomonadineae Pseudomonadineae Pseudomonadineae invalid #> 7 56 Nitrobacteraceae Nitrobacteraceae Nitrobacteraceae invalid #> 8 57 Nitrobacter Nitrobacter Nitrobacter valid #> 9 65 Nitrosomonas Nitrosomonas Nitrosomonas valid #> 10 70 Thiobacteriaceae Thiobacteriaceae Thiobacteriaceae invalid #> # ... with 22 more variables: unacceptReason , #> # credibilityRating , completenessRating , #> # currencyRating , kingdom , rankID , rank , #> # hierarchySoFar , hierarchySoFarWRanks , hierarchyTSN , #> # synonyms , synonymTSNs , otherSource , #> # acceptedTSN , comment , createDate , updateDate , #> # `_version_` , taxonAuthor , vernacular , #> # hierarchicalSort , parentTSN ``` matches only binomials ```r itis_search(q = "nameWOInd:/[A-Za-z0-9]*[%20]{1,1}[A-Za-z0-9]*/") #> # A tibble: 10 × 25 #> tsn nameWInd nameWOInd unit1 #> #> 1 58 Nitrobacter agilis Nitrobacter agilis Nitrobacter #> 2 59 Nitrobacter flavus Nitrobacter flavus Nitrobacter #> 3 60 Nitrobacter oligotrophis Nitrobacter oligotrophis Nitrobacter #> 4 61 Nitrobacter polytrophus Nitrobacter polytrophus Nitrobacter #> 5 62 Nitrobacter punctata Nitrobacter punctata Nitrobacter #> 6 64 Nitrobacter winogradskyi Nitrobacter winogradskyi Nitrobacter #> 7 66 Nitrosomonas europaea Nitrosomonas europaea Nitrosomonas #> 8 67 Nitrosomonas groningensis Nitrosomonas groningensis Nitrosomonas #> 9 68 Nitrosomonas javenensis Nitrosomonas javenensis Nitrosomonas #> 10 69 Nitrosomonas monocella Nitrosomonas monocella Nitrosomonas #> # ... with 21 more variables: unit2 , usage , #> # unacceptReason , credibilityRating , kingdom , #> # rankID , rank , hierarchySoFar , #> # hierarchySoFarWRanks , hierarchyTSN , synonyms , #> # synonymTSNs , otherSource , acceptedTSN , #> # comment , createDate , updateDate , `_version_` , #> # taxonAuthor , parentTSN , hierarchicalSort ``` ## REST API Get accepted names for a TSN ```r accepted_names(tsn = 504239) #> # A tibble: 1 × 3 #> acceptedName acceptedTsn author #> #> 1 Dasiphora fruticosa 836659 (L.) Rydb. ``` Get common names for a TSN ```r common_names(tsn = 183833) #> # A tibble: 3 × 3 #> commonName language tsn #> #> 1 African hunting dog English 183833 #> 2 African Wild Dog English 183833 #> 3 Painted Hunting Dog English 183833 ``` Full hierarchy for a TSN ```r hierarchy_full(tsn = 37906) #> # A tibble: 60 × 5 #> parentname parenttsn rankname taxonname tsn #> * #> 1 Kingdom Plantae 202422 #> 2 Plantae 202422 Subkingdom Viridiplantae 954898 #> 3 Viridiplantae 954898 Infrakingdom Streptophyta 846494 #> 4 Streptophyta 846494 Superdivision Embryophyta 954900 #> 5 Embryophyta 954900 Division Tracheophyta 846496 #> 6 Tracheophyta 846496 Subdivision Spermatophytina 846504 #> 7 Spermatophytina 846504 Class Magnoliopsida 18063 #> 8 Magnoliopsida 18063 Superorder Asteranae 846535 #> 9 Asteranae 846535 Order Asterales 35419 #> 10 Asterales 35419 Family Asteraceae 35420 #> # ... with 50 more rows ``` ## Meta * Please [report any issues or bugs](https://github.com/ropensci/ritis/issues). * License: MIT * Get citation information for `ritis` in R doing `citation(package = 'ritis')` * Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms. [![ropensci_footer](http://ropensci.org/public_images/github_footer.png)](http://ropensci.org) ritis/MD50000644000176200001440000001452713177057371011740 0ustar liggesusersc9bf29ab781edacc3ce92f248e42e004 *DESCRIPTION c5af52351472a750055a760a8924ce71 *LICENSE f190feff6fed516a9a30de61c46237fb *NAMESPACE e0362e855353a1830b14d444a293b0fb *NEWS.md 74410f0479c425f47a87e7e4e9e11568 *R/accepted_names.R ca9e4b76afebbbe08150094095a04de4 *R/any_match_count.R 2798e9e20801bc91e54ec6c42f7f5720 *R/comment_detail.R 6b0f97e4444c096a7cea2210f4de972a *R/common_names.R 173939232680a97dbb8e5743c01452c5 *R/core_metadata.R c855107acb697c9c501e78c8f7e53365 *R/coverage.R ab778390d467d74543346bb24098af97 *R/credibility.R e98c248feff880a6e31009b397f6befd *R/currency.R 5df323fca38a6ea58f8956044b175501 *R/date_data.R 0fb3739e2a4248e2cc43a3e29cee01a0 *R/description.R c28b73d93a3f0396452ea0cd9e5208c5 *R/experts.R 8d46685884e75786747392c836aaab14 *R/full_record.R 189cc649cb7d35ea7d69140edce07c95 *R/geographic_divisions.R 6366f584c43f834dca6ae479beb04a6c *R/geographic_values.R 4ae3bea1b347fe0434115b340a5fa25c *R/global_species_completeness.R d62168a72cc1c63ecd577e1ef3ff0fc2 *R/hierarchy.R 07fb2b26ce20174fdc16b49569e85668 *R/itis_facet.R 393fa3195d513b0c8a5e908b6b16c105 *R/itis_group.R 48893248bc5321fa84c77da4dfa58fea *R/itis_highlight.R b46d36af9ba34cc0cffdc91ec218862a *R/itis_search.R c122cb71976d24a9dacc7c3a18dcca87 *R/jurisdiction.R 9a1bd0aa0a4c47ad17265a3e714facc3 *R/kingdoms.R 5562fe5b96733bfd8aa169b65b77f357 *R/last_change_date.R 1489aba816debc43c183068bac05c612 *R/lsid2tsn.R 991d5518f53538a1bc9611c8338a4e5a *R/onload.R c295b8b74dfafa2ba5edc189fd4fa551 *R/other_sources.R ae4cb35f12886fe6ad8aff201e30ebb5 *R/parent_tsn.R 6a155b0a7288f3113c0b5bfcaf67af68 *R/publications.R d7daf12a1b7d149faccb4e33bc16bba1 *R/rank_name.R 8d0ee408a3b3604463280cac65d9e317 *R/rank_names.R e3a2c53537f1744c6fc203cb3a02301c *R/record.R 9e84a99d8505633d5bcc55a88c1a971a *R/review_year.R 40754f1e771f85ad0ab491f6aca702ee *R/ritis-package.R d7fb162d20ebd38d55fca32ad0b766ec *R/scientific_name.R adfbba5223b9cd14841ab1f78f497cbf *R/search_any_match_paged.R 4aff10fa25c21da56d5e844b78456afa *R/search_anymatch.R 6d9b707d24a4deaec5cad9e8f4c1ca72 *R/search_common.R 06ca45f837150df59d9f28261716ee50 *R/search_scientific.R dfead5cf85ca3c37aec06b16991c854b *R/solr.R af838c0db478551cdb3477181dbf501a *R/synonym_names.R 73b04e7b055f9379a3300ac926c30c63 *R/taxon_authorship.R c813a41b2ec7f5f896d6b1c2ac561f31 *R/terms.R ec6b05c86196b9bcb2a39b649a914ae8 *R/tsn2lsid.R c97573e0c0656ec6e8783ec062b654f4 *R/tsn_by_vernacular_language.R 646d9b37cbb94549d22e6319b4f3b73e *R/unacceptability_reason.R 2e07efe5b6307ce0429108512180467b *R/usage.R 0de47bbe5d47656743847efc327eec80 *R/vernacular_languages.R efc39dccf1425d5f8a3e2618ef8b2661 *R/zzz.R e909169c0268918e5ad4de7c13e40aed *README.md 4367ec7cd86f59ef0df494a1616eaab2 *build/vignette.rds 9e0a7a3907c8fe78e848f173265e6260 *inst/doc/ritis_vignette.Rmd 9eb3081bad62974cb4df49627f05dfb4 *inst/doc/ritis_vignette.html b5fc1b86f9d86ee10387c0ee4d6cf0f7 *inst/vign/ritis_vignette.Rmd 9e0a7a3907c8fe78e848f173265e6260 *inst/vign/ritis_vignette.md d66e68f30bba49a9c83b5fe53a5614d6 *man/accepted_names.Rd 61c7849294a8cc1c6b3ba94700e5bb1a *man/any_match_count.Rd 1ca3ea6862121d509468748d815e424f *man/comment_detail.Rd f0134a8499264262509344b3121255af *man/common_names.Rd 39f2cc4c34710f72a401e93b0421dec6 *man/core_metadata.Rd 35816015c493c4e561963fc999b7f26d *man/coverage.Rd d2ee354ae5b2a002f3c884d3d97f9344 *man/credibility.Rd 8f3046cd893c76276a63326c59ca7b43 *man/currency.Rd 5334fda9e4fefcc08e77c46a6b823e29 *man/date_data.Rd 2f60cc316f9125c751c51744d8538efb *man/description.Rd e894281f6185ff19b71348a8218319e5 *man/experts.Rd 76ce74750e96ae2b5982aa4aeb2752d9 *man/full_record.Rd 674edacc04d3171a146f89a2d2fc4acf *man/geographic_divisions.Rd b40dde847702309abaa021810b79f8d0 *man/geographic_values.Rd e22bc6fbd5ce7c0d3e24aef38196e6a8 *man/global_species_completeness.Rd 2d955fa84b9083d4dff2340e52647b55 *man/hierarchy.Rd 12bb244f41c5ed7e5ed42ec6039f209e *man/itis_facet.Rd 4c6c51e3237e50a589a4e7039df7199f *man/itis_group.Rd b5fcc9d2d5871fe960f7252f364aa79f *man/itis_highlight.Rd 7c0a10382898fe6d991fa819d79117ef *man/itis_search.Rd 0d2b5dbe219ece066e73f4a1448df23e *man/jurisdiction.Rd 3b24d916468554786a89b7239238676d *man/kingdoms.Rd aaa3237126fd53202cab9604be9c426e *man/last_change_date.Rd 542b4ebc23b6da8cdf1763ab1e8a2036 *man/lsid2tsn.Rd 938274bd6c4ca8df9c3dfae0b8f3bf61 *man/other_sources.Rd 424b95ee2233bc3d6562d4974dece3c4 *man/parent_tsn.Rd 29df151f9013db766ede4911643dbdae *man/publications.Rd cda1fc0fa0802f625609d6f580e42b8c *man/rank_name.Rd 9bb477b18591c7aaf5c3deffb7e21b04 *man/rank_names.Rd 5d332fea7eb15d650723fd4e18074aae *man/record.Rd 32d853c7613990cc25080c0df33af4f0 *man/review_year.Rd 598d8f20b9083eff6c3c95ea8bd1171c *man/ritis-package.Rd 0020779054d24397d9589fc614a597c6 *man/scientific_name.Rd f9903631109208b6d8e0ecd29916b96f *man/search_any_match_paged.Rd 6a52c7b7a0219685bc624e13d667a653 *man/search_anymatch.Rd 07c2b60c86cdbb7f07ae9ef0471c122d *man/search_common.Rd b9f2eb978b2ed794f4e4cfcb4ca10060 *man/search_scientific.Rd 8506ba065229c0a47e8e3f83fac89a94 *man/solr.Rd f5adf95f0cef804e6d89644ca192c522 *man/synonym_names.Rd 39bf9901a673fd9292cef751653d16c9 *man/taxon_authorship.Rd 501020759b9f5f328c378e5e109e5b9d *man/terms.Rd 1eed21e24b257a202ed106fc530b74ef *man/tsn2lsid.Rd f12a99b007e75c5937a676cc1983ef75 *man/tsn_by_vernacular_language.Rd b3e26d27add39358353fffa0a5ca8a74 *man/unacceptability_reason.Rd 81d90c720d511de76e9afcb38ca8ad58 *man/usage.Rd f8a48aa42210f6e5ef37725e8b875ff1 *man/vernacular_languages.Rd 680535a7e7ba6856cc630af23d88f514 *tests/test-all.R 6de6bfda4529c5811788f56ef88d257b *tests/testthat/helper.R 16d6cb8e540be05d6dd4b9c38b1dc29c *tests/testthat/test-any_match_count.R fe3efb1dc47b16fcc31016d5fbbb899f *tests/testthat/test-hierarchy.R 9fbd19b29c97b3e699b1f098227a5cf0 *tests/testthat/test-itis_facet.R 8f0cc9f23a1b5d1d63e57c5b79102f19 *tests/testthat/test-itis_group.R db34802164dd07e259d73716dd1a8887 *tests/testthat/test-itis_highlight.R b8d1e69d7cf3eec4ffa405bb73f3773a *tests/testthat/test-itis_search.R 1f9a7d5cae81492d825c0b80407aafa4 *tests/testthat/test-jurisdiction.R 6c7c1dc2a53bce55306459126d9236b4 *tests/testthat/test-kingdoms.R 163f8698f56add6d111def5025c871da *tests/testthat/test-publications.R fb9dc6f954548aecc6c83ee5d36249cd *tests/testthat/test-record.R d79f700bcedff969a0ad09b8ad4c9771 *tests/testthat/test-search_common.R b64e1e75d67150bc6c8790d4403821ed *tests/testthat/test-search_scientific.R 9e0a7a3907c8fe78e848f173265e6260 *vignettes/ritis_vignette.Rmd ritis/build/0000755000176200001440000000000013176715441012514 5ustar liggesusersritis/build/vignette.rds0000644000176200001440000000032013176715441015046 0ustar liggesusersmOA0,QHL| ŋ!Vm)U͗[ MvbBOhBIH!#^ieʣ֊_J*k4Vj qu NIs8 >Q "M3q?eV3„=&e%~ gHdtR-+`1g| 0ئritis/DESCRIPTION0000644000176200001440000000202213177057371013121 0ustar liggesusersPackage: ritis Title: Integrated Taxonomic Information System Client Description: An interface to the Integrated Taxonomic Information System ('ITIS') (). Includes functions to work with the 'ITIS' REST 'API' methods (), as well as the 'Solr' web service (). Version: 0.7.0 License: MIT + file LICENSE URL: https://github.com/ropensci/ritis BugReports: https://github.com/ropensci/ritis/issues Authors@R: c(person("Scott", "Chamberlain", role = c("aut", "cre"), email = "myrmecocystus@gmail.com")) VignetteBuilder: knitr Imports: solrium (>= 1.0.0), crul (>= 0.4.0), jsonlite (>= 1.5), data.table (>= 1.9.6), tibble (>= 1.3.4) Suggests: roxygen2 (>= 6.0.1), testthat, knitr RoxygenNote: 6.0.1 NeedsCompilation: no Packaged: 2017-11-02 22:24:33 UTC; sacmac Author: Scott Chamberlain [aut, cre] Maintainer: Scott Chamberlain Repository: CRAN Date/Publication: 2017-11-03 12:20:09 UTC ritis/man/0000755000176200001440000000000012732402574012165 5ustar liggesusersritis/man/search_any_match_paged.Rd0000644000176200001440000000220713162615700017100 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/search_any_match_paged.R \name{search_any_match_paged} \alias{search_any_match_paged} \title{Search for any matched page} \usage{ search_any_match_paged(x, pagesize = NULL, pagenum = NULL, ascend = NULL, wt = "json", raw = FALSE, ...) } \arguments{ \item{x}{text or taxonomic serial number (TSN) (character or numeric)} \item{pagesize}{An integer containing the page size (numeric)} \item{pagenum}{An integer containing the page number (numeric)} \item{ascend}{A boolean containing true for ascending sort order or false for descending (logical)} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ a data.frame a data.frame } \description{ Search for any matched page } \examples{ \dontrun{ search_any_match_paged(x=202385, pagesize=100, pagenum=1, ascend=FALSE) search_any_match_paged(x="Zy", pagesize=100, pagenum=1, ascend=FALSE) } } \seealso{ \code{\link{search_anymatch}} } ritis/man/itis_search.Rd0000644000176200001440000000275313174402476014762 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/itis_search.R \name{itis_search} \alias{itis_search} \title{ITIS Solr search} \usage{ itis_search(..., proxy = NULL, callopts = list()) } \arguments{ \item{...}{Arguments passed on to the \code{params} parameter of the \code{\link[solrium:solr_search]{solrium::solr_search()}} function} \item{proxy}{List of arguments for a proxy connection, including one or more of: url, port, username, password, and auth. See \code{\link[crul:proxy]{crul::proxy()}} for help, which is used to construct the proxy connection.} \item{callopts}{Curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \description{ ITIS Solr search } \examples{ \dontrun{ itis_search(q = "tsn:182662") itis_search(q = "nameWOInd:Liquidamber\\\\\%20styraciflua~0.4") # matches only monomials itis_search(q = "nameWOInd:/[A-Za-z0-9]*[\%20]{0,0}*/") # matches only binomials itis_search(q = "nameWOInd:/[A-Za-z0-9]*[\%20]{1,1}[A-Za-z0-9]*/") # matches only trinomials itis_search(q = "nameWOInd:/[A-Za-z0-9]*[\%20]{1,1}[A-Za-z0-9]*[\%20]{1,1}[A-Za-z0-9]*/") # matches binomials or trinomials itis_search(q = "nameWOInd:/[A-Za-z0-9]*[\%20]{1,1}[A-Za-z0-9]*[\%20]{0,1}[A-Za-z0-9]*/") itis_search(q = "nameWOInd:Poa\\\\\%20annua") itis_search(q = "nameWOInd:/[A-Za-z0-9]*[\%20]{0,0}*/", rows = 2) itis_search(q = "nameWOInd:/[A-Za-z0-9]*[\%20]{0,0}*/", rows = 200) itis_search(q = "nameWOInd:/[A-Za-z0-9]*[\%20]{0,0}*/", fl = c('nameWInd', 'tsn')) } } ritis/man/search_common.Rd0000644000176200001440000000272313162615150015267 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/search_common.R \name{search_common} \alias{search_common} \title{Search for tsn by common name} \usage{ search_common(x, from = "all", wt = "json", raw = FALSE, ...) } \arguments{ \item{x}{text or taxonomic serial number (TSN) (character or numeric)} \item{from}{(character) One of "all", "begin", or "end". See Details.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ a data.frame } \description{ Search for tsn by common name } \details{ The \code{from} parameter: \itemize{ \item all - Search against the \code{searchByCommonName} API route, which searches entire name string \item begin - Search against the \code{searchByCommonNameBeginsWith} API route, which searches for a match at the beginning of a name string \item end - Search against the \code{searchByCommonNameEndsWith} API route, which searches for a match at the end of a name string } } \examples{ \dontrun{ search_common("american bullfrog") search_common("ferret-badger") search_common("polar bear") # comparison: all, begin, end search_common("inch") search_common("inch", from = "begin") search_common("inch", from = "end") # end search_common("snake", from = "end") } } \seealso{ \code{\link[=search_scientific]{search_scientific()}} } ritis/man/rank_names.Rd0000644000176200001440000000144613162615700014572 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rank_names.R \name{rank_names} \alias{rank_names} \title{Provides a list of all the unique rank names contained in the database and their kingdom and rank ID values.} \usage{ rank_names(wt = "json", raw = FALSE, ...) } \arguments{ \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ a data.frame, with columns: \itemize{ \item kingdomname \item rankid \item rankname } } \description{ Provides a list of all the unique rank names contained in the database and their kingdom and rank ID values. } \examples{ \dontrun{ rank_names() } } ritis/man/description.Rd0000644000176200001440000000120613162615147014776 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/description.R \name{description} \alias{description} \title{Get description of the ITIS service} \usage{ description(wt = "json", raw = FALSE, ...) } \arguments{ \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ a string, the ITIS web service description } \description{ Get description of the ITIS service } \examples{ \dontrun{ description() description(wt = "xml") } } ritis/man/taxon_authorship.Rd0000644000176200001440000000130613162615700016046 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/taxon_authorship.R \name{taxon_authorship} \alias{taxon_authorship} \title{Returns the author information for the TSN.} \usage{ taxon_authorship(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ a data.frame } \description{ Returns the author information for the TSN. } \examples{ \dontrun{ taxon_authorship(tsn = 183671) } } ritis/man/ritis-package.Rd0000644000176200001440000000222213070301070015156 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/ritis-package.R \docType{package} \name{ritis-package} \alias{ritis-package} \alias{ritis} \title{Interface to Integrated Taxonomic Information (ITIS)} \description{ Interface to Integrated Taxonomic Information (ITIS) } \section{ritis package API}{ All functions that start with \code{itis_} work with the ITIS Solr API described at \url{http://www.itis.gov/solr_documentation.html}, which uses the package \pkg{solrium}, and these functions have you use the \pkg{solrium} function interfaces, so you can pass on parameters to the \pkg{solrium} functions - so the \pkg{solrium} docs are important here. All other functions work with the ITIS REST API described at \url{http://www.itis.gov/ws_description.html}. For these methods, they can grab data in either JSON or XML format. JSON is the default. We parse the JSON to R native format, either data.frame, character string, or list. You can get raw JSON as a character string back, or raw XML as a character string, and then parse yourself with \pkg{jsonlite} or \pkg{xml2} } \author{ Scott Chamberlain \email{myrmecocystus@gmail.com} } ritis/man/parent_tsn.Rd0000644000176200001440000000136213162615700014626 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/parent_tsn.R \name{parent_tsn} \alias{parent_tsn} \title{Returns the parent TSN for the entered TSN.} \usage{ parent_tsn(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ a data.frame } \description{ Returns the parent TSN for the entered TSN. } \examples{ \dontrun{ parent_tsn(tsn = 202385) parent_tsn(tsn = 202385, raw = TRUE) parent_tsn(tsn = 202385, wt = "xml") } } ritis/man/publications.Rd0000644000176200001440000000142213162615700015142 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/publications.R \name{publications} \alias{publications} \title{Returns a list of the pulications used for the TSN.} \usage{ publications(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ a data.frame } \description{ Returns a list of the pulications used for the TSN. } \examples{ \dontrun{ publications(tsn = 70340) publications(tsn = 70340, wt = "xml") publications(tsn = 70340, verbose = TRUE) } } ritis/man/geographic_divisions.Rd0000644000176200001440000000143413162615147016655 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/geographic_divisions.R \name{geographic_divisions} \alias{geographic_divisions} \title{Get geographic divisions from tsn} \usage{ geographic_divisions(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \description{ Get geographic divisions from tsn } \examples{ \dontrun{ geographic_divisions(tsn = 180543) geographic_divisions(tsn = 180543, wt = "xml") geographic_divisions(tsn = 180543, wt = "json", raw = TRUE) } } ritis/man/comment_detail.Rd0000644000176200001440000000131713162615147015442 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/comment_detail.R \name{comment_detail} \alias{comment_detail} \title{Get comment detail from TSN} \usage{ comment_detail(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ A data.frame with results. } \description{ Get comment detail from TSN } \examples{ \dontrun{ comment_detail(tsn=180543) comment_detail(tsn=180543, wt = "xml") } } ritis/man/credibility.Rd0000644000176200001440000000211313162615147014754 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/credibility.R \name{credibility} \alias{credibility} \alias{credibility_rating} \alias{credibility_ratings} \title{Get credibility rating from tsn} \usage{ credibility_rating(tsn, wt = "json", raw = FALSE, ...) credibility_ratings(wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ a data.frame } \description{ Get credibility rating from tsn } \details{ methods: \itemize{ \item credibility_rating: Get credibility rating for a tsn \item credibility_ratings: Get possible credibility ratings } } \examples{ \dontrun{ credibility_rating(tsn = 526852) credibility_rating(526852, wt = "xml") credibility_rating(526852, raw = TRUE) credibility_ratings() credibility_ratings(wt = "xml") credibility_ratings(raw = TRUE) } } ritis/man/lsid2tsn.Rd0000644000176200001440000000161513162615700014214 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/lsid2tsn.R \name{lsid2tsn} \alias{lsid2tsn} \title{Gets the TSN corresponding to the LSID, or an empty result if there is no match.} \usage{ lsid2tsn(lsid, wt = "json", raw = FALSE, ...) } \arguments{ \item{lsid}{(character) lsid for a taxonomic group. Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \description{ Gets the TSN corresponding to the LSID, or an empty result if there is no match. } \examples{ \dontrun{ lsid2tsn(lsid="urn:lsid:itis.gov:itis_tsn:28726") lsid2tsn(lsid="urn:lsid:itis.gov:itis_tsn:28726", wt = "xml") lsid2tsn("urn:lsid:itis.gov:itis_tsn:0") lsid2tsn("urn:lsid:itis.gov:itis_tsn:0", wt = "xml") } } ritis/man/date_data.Rd0000644000176200001440000000125313162615147014363 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/date_data.R \name{date_data} \alias{date_data} \title{Get date data from tsn} \usage{ date_data(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \description{ Get date data from tsn } \examples{ \dontrun{ date_data(tsn = 180543) date_data(180543, wt = "xml") date_data(180543, wt = "json", raw = TRUE) } } ritis/man/vernacular_languages.Rd0000644000176200001440000000133213162615700016636 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/vernacular_languages.R \name{vernacular_languages} \alias{vernacular_languages} \title{Provides a list of the unique languages used in the vernacular table.} \usage{ vernacular_languages(wt = "json", raw = FALSE, ...) } \arguments{ \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ a character vector of verncular names } \description{ Provides a list of the unique languages used in the vernacular table. } \examples{ \dontrun{ vernacular_languages() } } ritis/man/solr.Rd0000644000176200001440000000120013174373127013426 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/solr.R \name{solr} \alias{solr} \title{ITIS Solr Methods} \description{ ITIS provides access to their data via their Solr service described at \url{https://www.itis.gov/solr_documentation.html}. This is a powerful interace to ITIS data as you have access to a very flexible query interface. } \section{Functions}{ \itemize{ \item \code{\link[=itis_search]{itis_search()}} - Search \item \code{\link[=itis_group]{itis_group()}} - Group \item \code{\link[=itis_highlight]{itis_highlight()}} - Highlight \item \code{\link[=itis_facet]{itis_facet()}} - Facet } } ritis/man/global_species_completeness.Rd0000644000176200001440000000151513162615147020212 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/global_species_completeness.R \name{global_species_completeness} \alias{global_species_completeness} \title{Get global species completeness from tsn} \usage{ global_species_completeness(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \description{ Get global species completeness from tsn } \examples{ \dontrun{ global_species_completeness(tsn = 180541) global_species_completeness(180541, wt = "xml") global_species_completeness(180541, wt = "json", raw = TRUE) } } ritis/man/coverage.Rd0000644000176200001440000000124713162615147014253 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/coverage.R \name{coverage} \alias{coverage} \title{Get coverge from tsn} \usage{ coverage(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \description{ Get coverge from tsn } \examples{ \dontrun{ # coverage data coverage(tsn=28727) # no coverage data coverage(526852) coverage(526852, wt = "xml") } } ritis/man/itis_group.Rd0000644000176200001440000000154113174402476014643 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/itis_group.R \name{itis_group} \alias{itis_group} \title{ITIS Solr group search} \usage{ itis_group(..., proxy = NULL, callopts = list()) } \arguments{ \item{...}{Arguments passed on to the \code{params} parameter of the \code{\link[solrium:solr_group]{solrium::solr_group()}} function} \item{proxy}{List of arguments for a proxy connection, including one or more of: url, port, username, password, and auth. See \code{\link[crul:proxy]{crul::proxy()}} for help, which is used to construct the proxy connection.} \item{callopts}{Curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \description{ ITIS Solr group search } \examples{ \dontrun{ x <- itis_group(q = "nameWOInd:/[A-Za-z0-9]*[\%20]{1,1}[A-Za-z0-9]*/", group.field = 'rank', group.limit = 3) head(x) } } ritis/man/unacceptability_reason.Rd0000644000176200001440000000134713162615700017203 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/unacceptability_reason.R \name{unacceptability_reason} \alias{unacceptability_reason} \title{Returns the unacceptability reason, if any, for the TSN.} \usage{ unacceptability_reason(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \description{ Returns the unacceptability reason, if any, for the TSN. } \examples{ \dontrun{ unacceptability_reason(tsn = 183671) } } ritis/man/synonym_names.Rd0000644000176200001440000000140313162615700015344 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/synonym_names.R \name{synonym_names} \alias{synonym_names} \title{Returns a list of the synonyms (if any) for the TSN.} \usage{ synonym_names(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ a data.frame } \description{ Returns a list of the synonyms (if any) for the TSN. } \examples{ \dontrun{ synonym_names(tsn=183671) # tsn not accepted synonym_names(tsn=526852) # tsn accepted } } ritis/man/rank_name.Rd0000644000176200001440000000132613162615700014404 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/rank_name.R \name{rank_name} \alias{rank_name} \title{Returns the kingdom and rank information for the TSN.} \usage{ rank_name(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ a data.frame, with rank name and other info } \description{ Returns the kingdom and rank information for the TSN. } \examples{ \dontrun{ rank_name(tsn = 202385) } } ritis/man/hierarchy.Rd0000644000176200001440000000235213162615147014434 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/hierarchy.R \name{hierarchy} \alias{hierarchy} \alias{hierarchy_down} \alias{hierarchy_up} \alias{hierarchy_full} \title{Get hierarchy down from tsn} \usage{ hierarchy_down(tsn, wt = "json", raw = FALSE, ...) hierarchy_up(tsn, wt = "json", raw = FALSE, ...) hierarchy_full(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \description{ Get hierarchy down from tsn } \details{ Hierarchy methods: \itemize{ \item hierarchy_down: Get hierarchy down from tsn \item hierarchy_up: Get hierarchy up from tsn \item hierarchy_full: Get full hierarchy from tsn } } \examples{ \dontrun{ ## Full down (class Mammalia) hierarchy_down(tsn=179913) ## Full up (genus Agoseris) hierarchy_up(tsn=36485) ## Full hierarchy ### genus Liatris hierarchy_full(tsn=37906) ### get raw data back hierarchy_full(tsn=37906, raw = TRUE) ### genus Baetis, get xml back hierarchy_full(100800, wt = "xml") } } ritis/man/other_sources.Rd0000644000176200001440000000133013162615700015330 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/other_sources.R \name{other_sources} \alias{other_sources} \title{Returns a list of the other sources used for the TSN.} \usage{ other_sources(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \description{ Returns a list of the other sources used for the TSN. } \examples{ \dontrun{ other_sources(tsn=182662) other_sources(tsn=182662, wt = "xml") } } ritis/man/currency.Rd0000644000176200001440000000133713162615147014312 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/currency.R \name{currency} \alias{currency} \title{Get currency from tsn} \usage{ currency(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ a data.frame } \description{ Get currency from tsn } \examples{ \dontrun{ # currency data currency(tsn=28727) currency(tsn=28727, wt = "xml") # no currency dat currency(526852) currency(526852, raw = TRUE) } } ritis/man/record.Rd0000644000176200001440000000153613162615700013732 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/record.R \name{record} \alias{record} \title{Gets a record from an LSID} \usage{ record(lsid, wt = "json", raw = FALSE, ...) } \arguments{ \item{lsid}{lsid for a taxonomic group (character). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ a data.frame } \description{ Gets a record from an LSID } \details{ Gets the partial ITIS record for the TSN in the LSID, found by comparing the TSN in the search key to the TSN field. Returns an empty result set if there is no match or the TSN is invalid. } \examples{ \dontrun{ record(lsid = "urn:lsid:itis.gov:itis_tsn:180543") } } ritis/man/accepted_names.Rd0000644000176200001440000000163413162615147015413 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/accepted_names.R \name{accepted_names} \alias{accepted_names} \title{Get accepted names from tsn} \usage{ accepted_names(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ Zero row data.frame if the name is accepted, otherwise a data.frame with information on the currently accepted name } \description{ Get accepted names from tsn } \examples{ \dontrun{ # TSN accepted - good name accepted_names(tsn = 208527) # TSN not accepted - input TSN is old name accepted_names(tsn = 504239) # raw json accepted_names(tsn = 208527, raw = TRUE) } } ritis/man/tsn_by_vernacular_language.Rd0000644000176200001440000000145513162615700020037 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tsn_by_vernacular_language.R \name{tsn_by_vernacular_language} \alias{tsn_by_vernacular_language} \title{Get tsn by vernacular language} \usage{ tsn_by_vernacular_language(language, wt = "json", raw = FALSE, ...) } \arguments{ \item{language}{A string containing the language. This is a language string, not the international language code (character)} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ a data.frame } \description{ Get tsn by vernacular language } \examples{ \dontrun{ tsn_by_vernacular_language(language = "french") } } ritis/man/full_record.Rd0000644000176200001440000000172113162615147014755 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/full_record.R \name{full_record} \alias{full_record} \title{Get full record from TSN or lsid} \usage{ full_record(tsn = NULL, lsid = NULL, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{lsid}{lsid for a taxonomic group (character)} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \description{ Get full record from TSN or lsid } \examples{ \dontrun{ # from tsn full_record(tsn = 50423) full_record(tsn = 202385) full_record(tsn = 183833) full_record(tsn = 183833, wt = "xml") full_record(tsn = 183833, raw = TRUE) # from lsid full_record(lsid = "urn:lsid:itis.gov:itis_tsn:180543") full_record(lsid = "urn:lsid:itis.gov:itis_tsn:180543") } } ritis/man/kingdoms.Rd0000644000176200001440000000155413162615700014267 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/kingdoms.R \name{kingdoms} \alias{kingdoms} \alias{kingdom_name} \alias{kingdom_names} \title{Get kingdom names from tsn} \usage{ kingdom_name(tsn, wt = "json", raw = FALSE, ...) kingdom_names(wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \description{ Get kingdom names from tsn } \details{ \itemize{ \item kingdom_name: Get kingdom name for a TSN \item kingdom_names: Get all possible kingdom names } } \examples{ \dontrun{ kingdom_name(202385) kingdom_name(202385, wt = "xml") kingdom_names() } } ritis/man/jurisdiction.Rd0000644000176200001440000000251613162615700015161 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/jurisdiction.R \name{jurisdiction} \alias{jurisdiction} \alias{jurisdictional_origin} \alias{jurisdiction_origin_values} \alias{jurisdiction_values} \title{Get jurisdictional origin from tsn} \usage{ jurisdictional_origin(tsn, wt = "json", raw = FALSE, ...) jurisdiction_origin_values(wt = "json", raw = FALSE, ...) jurisdiction_values(wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ \itemize{ \item jurisdictional_origin: data.frame \item jurisdiction_origin_values: data.frame \item jurisdiction_values: character vector } } \description{ Get jurisdictional origin from tsn } \details{ Jurisdiction methods: \itemize{ \item jurisdictional_origin: Get jurisdictional origin from tsn \item jurisdiction_origin_values: Get jurisdiction origin values \item jurisdiction_values: Get all possible jurisdiction values } } \examples{ \dontrun{ jurisdictional_origin(tsn=180543) jurisdictional_origin(tsn=180543, wt = "xml") jurisdiction_origin_values() jurisdiction_values() } } ritis/man/experts.Rd0000644000176200001440000000125213162615147014146 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/experts.R \name{experts} \alias{experts} \title{Get expert information for the TSN.} \usage{ experts(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \description{ Get expert information for the TSN. } \examples{ \dontrun{ experts(tsn = 180544) experts(180544, wt = "xml") experts(180544, raw = TRUE) } } ritis/man/geographic_values.Rd0000644000176200001440000000131513162615147016143 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/geographic_values.R \name{geographic_values} \alias{geographic_values} \title{Get all possible geographic values} \usage{ geographic_values(wt = "json", raw = FALSE, ...) } \arguments{ \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ character vector of geographic names } \description{ Get all possible geographic values } \examples{ \dontrun{ geographic_values() geographic_values(wt = "xml") geographic_values(wt = "json", raw = TRUE) } } ritis/man/itis_highlight.Rd0000644000176200001440000000146613174402476015464 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/itis_highlight.R \name{itis_highlight} \alias{itis_highlight} \title{ITIS Solr highlight} \usage{ itis_highlight(..., proxy = NULL, callopts = list()) } \arguments{ \item{...}{Arguments passed on to the \code{params} parameter of the \code{\link[solrium:solr_highlight]{solrium::solr_highlight()}} function} \item{proxy}{List of arguments for a proxy connection, including one or more of: url, port, username, password, and auth. See \code{\link[crul:proxy]{crul::proxy()}} for help, which is used to construct the proxy connection.} \item{callopts}{Curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \description{ ITIS Solr highlight } \examples{ \dontrun{ itis_highlight(q = "rank:Species", hl.fl = 'rank', rows=10) } } ritis/man/core_metadata.Rd0000644000176200001440000000142613162615147015247 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/core_metadata.R \name{core_metadata} \alias{core_metadata} \title{Get core metadata from tsn} \usage{ core_metadata(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \description{ Get core metadata from tsn } \examples{ \dontrun{ # coverage and currrency data core_metadata(tsn=28727) core_metadata(tsn=28727, wt = "xml") # no coverage or currrency data core_metadata(183671) core_metadata(183671, wt = "xml") } } ritis/man/search_anymatch.Rd0000644000176200001440000000135313162615700015602 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/search_anymatch.R \name{search_anymatch} \alias{search_anymatch} \title{Search for any match} \usage{ search_anymatch(x, wt = "json", raw = FALSE, ...) } \arguments{ \item{x}{text or taxonomic serial number (TSN) (character or numeric)} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ a data.frame } \description{ Search for any match } \examples{ \dontrun{ search_anymatch(x = 202385) search_anymatch(x = "dolphin") } } \seealso{ \code{\link{search_any_match_paged}} } ritis/man/terms.Rd0000644000176200001440000000220213162615700013575 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/terms.R \name{terms} \alias{terms} \title{Get ITIS terms, i.e., tsn's, authors, common names, and scientific names.} \usage{ terms(query, what = "both", wt = "json", raw = FALSE, ...) } \arguments{ \item{query}{One or more common or scientific names, or partial names} \item{what}{One of both (search common and scientific names), common (search just common names), or scientific (search just scientific names)} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \description{ Get ITIS terms, i.e., tsn's, authors, common names, and scientific names. } \examples{ \dontrun{ # Get terms searching both common and scientific names terms(query='bear') # Get terms searching just common names terms(query='tarweed', "common") # Get terms searching just scientific names terms(query='Poa annua', "scientific") # many at once terms(query=c('Poa annua', 'Pinus contorta'), "scientific") } } ritis/man/last_change_date.Rd0000644000176200001440000000126713162615700015722 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/last_change_date.R \name{last_change_date} \alias{last_change_date} \title{Provides the date the ITIS database was last updated} \usage{ last_change_date(wt = "json", raw = FALSE, ...) } \arguments{ \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ character value with a date } \description{ Provides the date the ITIS database was last updated } \examples{ \dontrun{ last_change_date() last_change_date(wt = "xml") } } ritis/man/any_match_count.Rd0000644000176200001440000000143413162615147015631 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/any_match_count.R \name{any_match_count} \alias{any_match_count} \title{Get any match count.} \usage{ any_match_count(x, wt = "json", raw = FALSE, ...) } \arguments{ \item{x}{text or taxonomic serial number (TSN) (character or numeric)} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ An integer containing the number of matches the search will return. } \description{ Get any match count. } \examples{ \dontrun{ any_match_count(x = 202385) any_match_count(x = "dolphin") any_match_count(x = "dolphin", wt = "xml") } } ritis/man/usage.Rd0000644000176200001440000000126613162615700013560 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/usage.R \name{usage} \alias{usage} \title{Returns the usage information for the TSN.} \usage{ usage(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \description{ Returns the usage information for the TSN. } \examples{ \dontrun{ usage(tsn = 526852) usage(tsn = 526852, raw = TRUE) usage(tsn = 526852, wt = "xml") } } ritis/man/tsn2lsid.Rd0000644000176200001440000000154013162615700014211 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/tsn2lsid.R \name{tsn2lsid} \alias{tsn2lsid} \title{Gets the unique LSID for the TSN, or an empty result if there is no match.} \usage{ tsn2lsid(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ a character string, an LSID, or \code{NULL} if nothing found } \description{ Gets the unique LSID for the TSN, or an empty result if there is no match. } \examples{ \dontrun{ tsn2lsid(tsn = 155166) tsn2lsid(tsn = 333333333) tsn2lsid(155166, raw = TRUE) tsn2lsid(155166, wt = "xml") } } ritis/man/scientific_name.Rd0000644000176200001440000000153313162615700015571 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/scientific_name.R \name{scientific_name} \alias{scientific_name} \title{Returns the scientific name for the TSN. Also returns the component parts (names and indicators) of the scientific name.} \usage{ scientific_name(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ a data.frame } \description{ Returns the scientific name for the TSN. Also returns the component parts (names and indicators) of the scientific name. } \examples{ \dontrun{ scientific_name(tsn = 531894) } } ritis/man/review_year.Rd0000644000176200001440000000123713162615700014773 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/review_year.R \name{review_year} \alias{review_year} \title{Returns the review year for the TSN.} \usage{ review_year(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ a data.frame } \description{ Returns the review year for the TSN. } \examples{ \dontrun{ review_year(tsn = 180541) } } ritis/man/itis_facet.Rd0000644000176200001440000000177713174402476014604 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/itis_facet.R \name{itis_facet} \alias{itis_facet} \title{ITIS Solr facet} \usage{ itis_facet(..., proxy = NULL, callopts = list()) } \arguments{ \item{...}{Arguments passed on to the \code{params} parameter of the \code{\link[solrium:solr_facet]{solrium::solr_facet()}} function} \item{proxy}{List of arguments for a proxy connection, including one or more of: url, port, username, password, and auth. See \code{\link[crul:proxy]{crul::proxy()}} for help, which is used to construct the proxy connection.} \item{callopts}{Curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \description{ ITIS Solr facet } \examples{ \dontrun{ itis_facet(q = "rank:Species", rows = 0, facet.field = "kingdom")$facet_fields x <- itis_facet(q = "hierarchySoFar:*$Aves$* AND rank:Species AND usage:valid", facet.pivot = "nameWInd,vernacular", facet.limit = -1, facet.mincount = 1, rows = 0) head(x$facet_pivot$`nameWInd,vernacular`) } } ritis/man/search_scientific.Rd0000644000176200001440000000140013162615700016107 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/search_scientific.R \name{search_scientific} \alias{search_scientific} \title{Search by scientific name} \usage{ search_scientific(x, wt = "json", raw = FALSE, ...) } \arguments{ \item{x}{text or taxonomic serial number (TSN) (character or numeric)} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ a data.frame } \description{ Search by scientific name } \examples{ \dontrun{ search_scientific("Tardigrada") search_scientific("Quercus douglasii") } } \seealso{ \code{\link{search_common}} } ritis/man/common_names.Rd0000644000176200001440000000126113162615147015127 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/common_names.R \name{common_names} \alias{common_names} \title{Get common names from tsn} \usage{ common_names(tsn, wt = "json", raw = FALSE, ...) } \arguments{ \item{tsn}{TSN for a taxonomic group (numeric). Required.} \item{wt}{(character) One of "json" or "xml". Required.} \item{raw}{(logical) Return raw JSON or XML as character string. Required. Default: \code{FALSE}} \item{...}{curl options passed on to \link[crul:HttpClient]{crul::HttpClient}} } \value{ a data.frame } \description{ Get common names from tsn } \examples{ \dontrun{ common_names(tsn=183833) common_names(tsn=183833, wt = "xml") } } ritis/LICENSE0000644000176200001440000000005713070301530012403 0ustar liggesusersYEAR: 2017 COPYRIGHT HOLDER: Scott Chamberlain