R client for Dryad web services
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
R
inst
man
tests
.Rbuildignore
.gitignore
.travis.yml
CODE_OF_CONDUCT.md
DESCRIPTION
LICENSE
NAMESPACE
NEWS.md
README.Rmd
README.md
codemeta.json
cran-comments.md
rdryad.Rproj

README.md

rdryad

Project Status: Active - The project has reached a stable, usable state and is being actively developed. Build Status codecov cran checks rstudio mirror downloads cran version

rdryad is a package to interface with the Dryad data repository.

Installation

Install Dryad from CRAN

install.packages("rdryad")

Or install development version of rdryad from GitHub:

devtools::install_github("ropensci/rdryad")
library('rdryad')

Examples

Solr search interface

Basic search, restricting to certain fields for brevity

d_solr_search(q="Galliard", fl='handle,dc.title_sort')
#> # A tibble: 10 x 2
#>    handle          dc.title_sort                                          
#>    <chr>           <chr>                                                  
#>  1 252539          <NA>                                                   
#>  2 10255/dryad.88… Data from: Inconsistency between different measures of…
#>  3 10255/dryad.86… Data from: Quantification of correlational selection o…
#>  4 10255/dryad.36… Data from: Patterns and processes of dispersal behavio…
#>  5 10255/dryad.15… Data from: Water restriction causes an intergeneration…
#>  6 10255/dryad.84… Data from: An experimental test of density-dependent s…
#>  7 10255/dryad.34… Data from: Population and life-history consequences of…
#>  8 10255/dryad.17… Data from: Reduction of baseline corticosterone secret…
#>  9 10255/dryad.13… Data from: Sex-specific density-dependent secretion of…
#> 10 10255/dryad.10… Data from: Climate and habitat interacts to shape the …

Dryad data based on an article DOI:

d_solr_search(q="dc.relation.isreferencedby:10.1038/nature04863",
   fl="dc.identifier,dc.title_ac")
#> # A tibble: 1 x 2
#>   dc.identifier                        dc.title_ac                        
#>   <chr>                                <chr>                              
#> 1 doi:10.5061/dryad.8426doi:10.5061/d… Data from: Minimal ProtoHox cluste…

All terms in the dc.subject facet, along with their frequencies:

d_solr_facet(q="location:l2", facet.field="dc.subject_filter", facet.minCount=1,
   facet.limit=10)
#> $facet_queries
#> NULL
#> 
#> $facet_fields
#> $facet_fields$dc.subject_filter
#> # A tibble: 10 x 2
#>    term                                                              value
#>    <chr>                                                             <chr>
#>  1 adaptation|||Adaptation                                           809  
#>  2 population genetics - empirical|||Population Genetics - Empirical 594  
#>  3 speciation|||Speciation                                           493  
#>  4 ecological genetics|||Ecological Genetics                         394  
#>  5 climate change|||climate change                                   387  
#>  6 phylogeography|||Phylogeography                                   379  
#>  7 hybridization|||Hybridization                                     350  
#>  8 phylogeny|||phylogeny                                             316  
#>  9 conservation genetics|||Conservation Genetics                     304  
#> 10 insects|||Insects                                                 290  
#> 
#> 
#> $facet_pivot
#> NULL
#> 
#> $facet_dates
#> NULL
#> 
#> $facet_ranges
#> NULL

Article DOIs associated with all data published in Dryad over the past 90 days:

d_solr_search(q="dc.date.available_dt:[NOW-90DAY/DAY TO NOW]",
   fl="dc.relation.isreferencedby", rows=10)
#> # A tibble: 5 x 1
#>   dc.relation.isreferencedby      
#>   <chr>                           
#> 1 doi:10.3389/fevo.2018.00138     
#> 2 doi:10.1002/ece3.4479           
#> 3 doi:10.7554/elife.35949         
#> 4 doi:10.1007/s10592-018-1106-3   
#> 5 doi:10.1212/wnl.0000000000006116

OAI-PMH interface

Identify the service

dr_identify()
#>             repositoryName                              baseURL
#> 1 Dryad Digital Repository http://api.datadryad.org/oai/request
#>   protocolVersion     adminEmail    earliestDatestamp deletedRecord
#> 1             2.0 root@localhost 2001-01-01T00:00:00Z    persistent
#>            granularity compression compression.1
#> 1 YYYY-MM-DDThh:mm:ssZ        gzip       deflate
#>                                                                                                                                                                 description
#> 1 OCLC's OAICat Repository FrameworkJeffrey A. Youngjyoung@oclc.orgOCLC1.5.48http://alcme.oclc.org/oaicat/oaicat_icon.gifhttp://www.oclc.org/research/software/oai/cat.shtm

List sets

dr_list_sets()
#> # A tibble: 8 x 2
#>   setSpec              setName            
#>   <chr>                <chr>              
#> 1 hdl_10255_dryad.148  BIRDD              
#> 2 hdl_10255_2          Dryad Data Files   
#> 3 hdl_10255_3          Dryad Data Packages
#> 4 hdl_10255_dryad.7872 DryadLab Activities
#> 5 hdl_10255_dryad.7871 DryadLab Packages  
#> 6 hdl_10255_dryad.2027 KNB                
#> 7 hdl_10255_dryad.2171 TreeBASE           
#> 8 hdl_10255_1          Main

Get records

dr_get_records(ids = 'oai:secundus.datadryad.org:10255/dryad.8820')
#> $`oai:secundus.datadryad.org:10255/dryad.8820`
#> $`oai:secundus.datadryad.org:10255/dryad.8820`$header
#> # A tibble: 1 x 3
#>   identifier                                datestamp           setSpec   
#>   <chr>                                     <chr>               <chr>     
#> 1 oai:secundus.datadryad.org:10255/dryad.8… 2015-10-29T06:27:5… hdl_10255…
#> 
#> $`oai:secundus.datadryad.org:10255/dryad.8820`$metadata
#> # A tibble: 1 x 9
#>   title  creator  subject  date  type  identifier relation coverage rights
#>   <chr>  <chr>    <chr>    <chr> <chr> <chr>      <chr>    <chr>    <chr> 
#> 1 NEXUS… Janies,… Echinod… 2011… Data… doi:10.50… doi:10.… World's… http:…

Get download URLs from a Dryad identifier (DOI)

dryad_files('10.5061/dryad.1758')
#> [1] "http://datadryad.org/bitstream/handle/10255/dryad.1759/dataset.csv?sequence=1"
#> [2] "http://datadryad.org/bitstream/handle/10255/dryad.1759/README.txt?sequence=2"

Download a file

Does not read file into, just a helper to get data files

dryad_fetch(dryad_files('10.5061/dryad.1758'))

By default dryad_fetch() will download to temporary files (note that these are cleaned up at the end of your R session). Check out the documentation for other options.

Get file DOIs from a package DOI

dryad_package_dois('10.5061/dryad.60699')
#> [1] "10.5061/dryad.60699/1" "10.5061/dryad.60699/2" "10.5061/dryad.60699/3"
#> [4] "10.5061/dryad.60699/4" "10.5061/dryad.60699/5" "10.5061/dryad.60699/6"

Get metadata for a DOI

Works for both package DOIs and for DOIs for files within packages

dryad_metadata('10.5061/dryad.9t0n8')
#> $desc
#> # A tibble: 25 x 6
#>    text                   qualifier  confidence mdschema element authority
#>    <chr>                  <chr>      <chr>      <chr>    <chr>   <chr>    
#>  1 Lawing, A. Michelle    author     NOVALUE    dc       contri… <NA>     
#>  2 Eronen, Jussi T.       author     NOVALUE    dc       contri… <NA>     
#>  3 Blois, Jessica L.      author     NOVALUE    dc       contri… <NA>     
#>  4 Graham, Catherine H.   author     NOVALUE    dc       contri… <NA>     
#>  5 Polly, P. David        author     NOVALUE    dc       contri… <NA>     
#>  6 2016-05-18T15:17:33Z   accession… <NA>       dc       date    <NA>     
#>  7 2016-05-18T15:17:33Z   available  <NA>       dc       date    <NA>     
#>  8 2016-04-27             issued     <NA>       dc       date    <NA>     
#>  9 doi:10.5061/dryad.9t0… <NA>       <NA>       dc       identi… <NA>     
#> 10 Lawing AM, Eronen JT,… citation   <NA>       dc       identi… <NA>     
#> # ... with 15 more rows
#> 
#> $files
#> # A tibble: 0 x 0
#> 
#> $attributes
#> # A tibble: 9 x 2
#>   attr        text                                     
#>   <chr>       <chr>                                    
#> 1 PROFILE     DSPACE METS SIP Profile 1.0              
#> 2 LABEL       DSpace Item                              
#> 3 OBJID       /handle/10255/dryad.116170               
#> 4 ID          hdl:10255/dryad.116170                   
#> 5 OBJEDIT     /admin/item?itemID=159223                
#> 6 xmlns:mets  http://www.loc.gov/METS/                 
#> 7 xmlns:xlink http://www.w3.org/TR/xlink/              
#> 8 xmlns:xsi   http://www.w3.org/2001/XMLSchema-instance
#> 9 xmlns:dim   http://www.dspace.org/xmlns/dspace/dim   
#> 
#> $structMap
#> $structMap$div
#> list()
#> attr(,"DMDID")
#> [1] "dmd_1"
#> attr(,"TYPE")
#> [1] "DSpace Item"
#> 
#> attr(,"LABEL")
#> [1] "DSpace"
#> attr(,"TYPE")
#> [1] "LOGICAL"

Meta

  • Please report any issues or bugs.
  • License: MIT
  • Get citation information for rdryad in R doing citation(package = 'rdryad')
  • Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

ropensci_footer

Data provided by...

Data is provided from the Dryad API.