Package rdpla. August 13, 2017

Similar documents
Package mregions. October 17, 2017

Package mrchmadness. April 9, 2017

Package macleish. January 3, 2018

Package STI. August 19, Index 7. Compute the Standardized Temperature Index

Package pinnacle.data

Package gvc. R topics documented: August 29, Version Title Global Value Chains Tools

Package jackstraw. August 7, 2018

Package nhlscrapr. R topics documented: March 8, Type Package

Package physiology. July 16, 2018

Gaia ARI. ARI s Gaia Workshop. Grégory Mantelet. 20 th June 2018 CDS / ARI

Package simmr. August 29, 2016

Mac Software Manual for FITstep Pro Version 2

Package BAwiR. January 25, 2018

Formula E Statistics Feeds

We release Mascot Server 2.6 at the end of last year. There have been a number of changes and improvements in the search engine and reports.

The MQ Console and REST API

Package ExactCIdiff. February 19, 2015

Horse Farm Management s Report Writer. User Guide Version 1.1.xx

Formula 1 Statistics Feeds

TABLE C: STATE MANDATES AND FUNDING LEVELS

2017 Census Reporting To access the SOI s Census Reporting web site go to:

Working with Marker Maps Tutorial

Using SQL in MS Access

Proform Software Upgrade v1.9.1 Release Notes Welcome to release of the Proform Form Book and System Builder.

Inspection User Manual

REMOTE CLIENT MANAGER HELP VERSION 1.0.2

- 2 - Companion Web Site. Back Cover. Synopsis

CSE 154: Web Programming Spring 2017 Homework Assignment 5: Pokedex. Overview. Due Date: Tuesday, May 9th

Club s Homepage Use this feature to return the club s website.

Delta Compressed and Deduplicated Storage Using Stream-Informed Locality

FIBA Europe Coaching Website. Manual. Practice Section

Software Manual for FITstep Pro Version 2

Oracle ebusiness CCTM Supplier: Rate Card

Conduent EDI Solutions, Inc. Eligibility Gateway 270/271 Payer Guide Medicaid

Microsoft Windows Software Manual for FITstep Stream Version 4

Inspection User Manual This application allows you to easily inspect equipment located in Onix Work.

Company Surge TM for. Installation Guide v4.0 January

TOURNAMENT TEAM REGISTRATION INSTRUCTIONS:

Traffic Safety Facts. State Traffic Data Data. Overview

SQL LiteSpeed 3.0 Installation Guide

Xerox EDI Eligibility Gateway 270/271 Payer Guide

23 August 2016 Page: 1

League Of Legends Statistics Feeds

User Help. Fabasoft Scrum

How to run a club night

(POM )

HOW TO SETUP ROUND ROBIN IN DARTS FOR WINDOWS

RSKtools for Matlab processing RBR data

Package multisom. May 23, 2017

Sample Final Exam MAT 128/SOC 251, Spring 2018

Catena Media analysis of how we expect sports betting to roll out across the United States of America.

BVIS Beach Volleyball Information System

Best practice with OJS a partial view

Apple Device Instruction Guide- High School Game Center (HSGC) Football Statware

LiteSpeed for SQL Server 6.5. Integration with TSM

UNIVERSITY OF PITTSBURGH LIBRARIES LONG TERM TRENDS ( )

Ameren Oracle ebusiness CCTM Supplier

Prerequisites: Layout:

Oxygen Meter User Manual

in Hull Richard Green

Dive Planet. Manual. Rev Basic User Interface. 2 How to organize your dives. 3 Statistics. 4 Location Service and Map View.

Excel 2013 Pivot Table Calculated Field Greyed Out

averun.com Installation Guide

N4 Hazards (Hazardous Cargo) Training Document

HOW TO SUBMIT YOUR RACE RESULTS ONLINE?

How to Setup and Score a Tournament. May 2018

Catena Media analysis of how we expect sports betting to roll out across the United States of America.

TECHNICAL NOTE HOW TO USE LOOPERS. Kalipso_TechDocs_Loopers. Revision: 1.0. Kalipso version: Date: 16/02/2017.

CT PET-2018 Part - B Phd COMPUTER APPLICATION Sample Question Paper

Together, we are creating a world that works better.

Package BAwiR. February 17, 2019

XC2 Client/Server Installation & Configuration

Finding peer-reviewed articles. Slide 1 - Slide 1. Page 1 of 33

Club s Homepage Welcome Club Calendar Logout Add a Request Play Date Requested Time Hole Selection # of Tee Times Break Link

Allocation of referees, hours and pistes User manual of Engarde - August, 2013

Team BUSY : Excise register RG-23 A-11, provision made to input starting S.No.

Configuring Bidirectional Forwarding Detection for BGP

Package mlbstats. March 16, 2018

GHSA Swimming/Diving POP School User s Guide

IBIS File : Problems & Software Solution

EchoR package tutorial

How to Use DeVry Library Databases for NoodleTools

swmath - Challenges, Next Steps, and Outlook

Web Based Bicycle Trip Planning for Broward County, Florida

States. Postal Abbreviations LEARN THE. AND. by Joy A. Miller

SCW Web Portal Instructions

Understood, Inc. User Guide SCUBA Solutions Version 1.7

μsmartdigi Presented at Ham-Com 2008 Plano Texas June 2008 by Rich Painter, AB VO Painter Engineering, Inc.

Pegas 4000 MF Gas Mixer InstructionManual Columbus Instruments

Pacific Region Contaminants Atlas

Fencing Time Version 4.3

United States Flags. Gauge: 28 sts = 4", though gauge is not critical. Use any yarn and a needle size that gives you a fabric you like.

DOT HS November 2009 Geospatial Analysis of Rural Motor Vehicle Traffic Fatalities

Track B: Particle Methods Part 2 PRACE Spring School 2012

Workshops & Tours WEDNESDAY. 7:30am-9:30pm. June 27. Library Tour 8:30 am 9:00 am and 12:30 pm 1:00 pm

TRAP MOM FUN SHOOT 2011

Error! Bookmark not defined. Error! Bookmark not defined. Error! Bookmark not defined.

Walking up Scenic Hills: Towards a GIS Based Typology of Crowd Sourced Walking Routes

Acknowledgments...iii. Section 1: Introduction to /ILE... 1

Accessing the Manual Punch Reports

Transcription:

Type Package Package rdpla August 13, 2017 Title Client for the Digital Public Library of America ('DPLA') Interact with the Digital Public Library of America <https://dp.la> ('DPLA') 'REST' 'API' <https://dp.la/info/developers/codex/> from R, including search and more. Version 0.2.0 License MIT + file LICENSE URL https://github.com/ropensci/rdpla BugReports https://github.com/ropensci/rdpla/issues LazyData yes VignetteBuilder knitr Imports crul (>= 0.3.8), jsonlite (>= 1.0), tibble, data.table, hoardr Suggests roxygen2 (>= 6.0.1), knitr, testthat, ggplot2, lubridate, scales RoxygenNote 6.0.1 NeedsCompilation no Author Scott Chamberlain [aut, cre] Maintainer Scott Chamberlain <myrmecocystus@gmail.com> Repository CRAN Date/Publication 2017-08-13 17:14:17 UTC R topics documented: rdpla-package........................................ 2 country_codes........................................ 2 dpla_bulk.......................................... 3 dpla_cache......................................... 5 dpla_collections....................................... 6 dpla_fields.......................................... 7 1

2 country_codes dpla_get_key........................................ 7 dpla_items.......................................... 8 language_codes....................................... 11 Index 12 rdpla-package R Client for the Digital Public Library of America (DPLA). Interact with the Digital Public Library of America (DPLA) REST API from R, including search. For an introduction to rdpla, see the vignette Introduction to rdpla Package API The following are the main functions in rdpla dpla_items - Work with the DPLA items endpoint dpla_collections - Work with the DPLA collections endpoint dpla_bulk - Download bulk and compressed JSON data Authentication See dpla_get_key() for authentication help. Author(s) Scott Chamberlain country_codes Country codes A data.frame (249 rows, 2 columns) containing all language codes. The columns are as follows: code. country code name. country name

dpla_bulk 3 dpla_bulk Get bulk DPLA data Usage Get bulk DPLA data dpla_bulk(year, month, key,...) dpla_bulk_list(...) Arguments year month key Value (character) a year between 2015 and the current year (character) between 1 (January) and 12 (December) (character) a dataset name key, see.... Curl options passed on to crul::httpclient() All data in the DPLA repository are available for download as gzipped JSON files. These include the standard DPLA fields, as well as the complete record received from the partner. See https://digitalpubliclibraryofamerica.atlassian.net/wiki/spaces/tech/pages/5931056/ Database+export+files for description of the structure of the files dpla_bulk doesn t attempt to read in the bulk JSON files as they can be quite large - so we leave that to the user. dpla_bulk_list returns the partial paths for JSON dataset dumps; append the base URL https://dpla-provider-export. to the beginning to get the full URL. dpla_bulk returns a path to the compressed JSON file. Allowed Keys all artstor bhl cdl david_rumsey digital_commonwealth digitalnc esdn

4 dpla_bulk georgia getty gpo harvard hathitrust il indiana internet_archive kdl lc maine maryland mdl michigan missouri_hub mwdl nara nypl pa pennsylvania scdl smithsonian tennessee the_portal_to_texas_history tn Examples uiuc usc virginia washington wisconsin ## Not run: dpla_bulk(year = 2016, month = 4, key = "nypl") res <- dpla_bulk(year = 2017, month = 1, key = "artstor") ## End(Not run)

dpla_cache 5 dpla_cache Caching Manage cached rdpla files with hoardr The dafault cache directory is paste0(rappdirs::user_cache_dir(), "/R/rdpla"), but you can set your own path using cache_path_set() cache_delete only accepts 1 file name, while cache_delete_all doesn t accept any names, but deletes all files. For deleting many specific files, use cache_delete in a lapply() type call Useful user functions dpla_cache$cache_path_get() get cache path dpla_cache$cache_path_set() set cache path dpla_cache$list() returns a character vector of full path file names dpla_cache$files() returns file objects with metadata dpla_cache$details() returns files with details dpla_cache$delete() delete specific files dpla_cache$delete_all() delete all files, returns nothing Examples ## Not run: dpla_cache # list files in cache dpla_cache$list() # delete certain database files # dpla_cache$delete("file path") # dpla_cache$list() # delete all files in cache # dpla_cache$delete_all() # dpla_cache$list() # set a different cache path from the default ## End(Not run)

6 dpla_collections dpla_collections Search collections from the Digital Public Library of America (DPLA). Search collections from the Digital Public Library of America (DPLA). Usage dpla_collections(q = NULL, title = NULL, description = NULL, fields = NULL, sort_by = NULL, page_size = 10, page = NULL, key = NULL,...) Arguments q title description fields sort_by (character) Query terms. (character) Query in the title field (character) Query in the description field (character) A vector of the fields to return in the output. The default is all fields. See dpla_fields for options. (character) The default sort order is ascending. Most, but not all fields can be sorted on. Attempts to sort on an un-sortable field will return the standard error structure with a HTTP 400 status code. page_size (integer) Number of items to return. Default: 10. Max: 500. page key (integer) Page number to return. Default: NULL (which means this parameter is not passed to DPLA, so they default to 1) (character) Your DPLA API key. See dpla_get_key()... Curl options passed on to crul::httpclient() Value A list with two slots: meta - a tibble/data.frame of metadata for the response, with one row and two columns: found - number of records found matching criteria returned - number of records returned data - a tibble/data.frame of the data; empty data.frame if no data matches your request; structure varies depending on search criteria

dpla_fields 7 Examples ## Not run: dpla_collections(q="university of texas", page_size=2) dpla_collections(q="university of texas", fields='id', page_size=2) dpla_collections(q="university of texas", sort_by='title', page_size=5) dpla_collections(title="paso") dpla_collections(description="east") # use curl options dpla_collections(q="university", verbose = TRUE) ## End(Not run) dpla_fields Metadata providers data.frame A data.frame (46 rows, 2 columns) containing all the DPLA fields. The columns are as follows: field. Name of the field. field_description. of the field. dpla_get_key Request an API key from the Digital Public Library of America (DPLA). Request an API key from the Digital Public Library of America (DPLA). Usage dpla_get_key(email,...) Arguments email (character) An email address.... Curl options passed on to crul::httpclient()

8 dpla_items Value You are required to have an API key to use rdpla. To get one, use dpla_get_key for getting a key programatically. After getting the key, you can pass the key as a parameter to rdpla functions, but we recommend storing the key on your machine, since not exposing your key in your files that may end up on the web is good practice. Store your key either as an environment variable in your.renviron file or similar like DPLA_API_KEY=<yourkey>, or as an R option in your.rprofile file like options(dpla_api_key = "<yourkey>"). Either will be read in when you call rdpla functions. Make sure to restart your R session after storing your key as either env var or R option. On success, a message that your API key will be emailed to you. Examples ## Not run: # dpla_get_key(email="stuff@thing.com") ## End(Not run) dpla_items Search items from the Digital Public Library of America (DPLA). Usage Search items from the Digital Public Library of America (DPLA). dpla_items(q = NULL, description = NULL, title = NULL, subject = NULL, creator = NULL, type = NULL, publisher = NULL, format = NULL, rights = NULL, contributor = NULL, provider = NULL, sp = NULL, sp_coordinates = NULL, sp_city = NULL, sp_county = NULL, sp_distance = NULL, sp_country = NULL, sp_code = NULL, sp_name = NULL, sp_region = NULL, sp_state = NULL, fields = NULL, sort_by = NULL, date = NULL, date_before = NULL, date_after = NULL, language = NULL, page_size = 100, page = NULL, facets = NULL, facet_size = 100, key = NULL, what = "table",...) Arguments q description title subject creator (character) Query terms. (character) Object description. (character) Object title. (character) Subject area (character) Creator name

dpla_items 9 type publisher format rights contributor provider sp (character) Type of object (character) Publisher (character) Format (character) Rights (character) Contributor (character) Provider (character) Query all spatial fields. sp_coordinates (character) Query only coordinates. Of the form <latitude,longitude> sp_city sp_county sp_distance sp_country (character) Query by city name. (character) Query by county name. (character) Distance from point defined in the sp_coordinates field (character) Query by location country sp_code (character) Query by ISO 3166-2 country code. Codes are included in this package, see country_codes. Find out more at https://www.iso.org/obp/ ui/#search sp_name sp_region sp_state fields sort_by date date_before date_after language (character) Location name. (character) Name of a region, e.g., "Upstate New York" (literal) (character) ISO 3166-2 code for a U.S. state or territory (character) A vector of the fields to return in the output. The default is all fields. See dpla_fields for options. (character) The default sort order is ascending. Most, but not all fields can be sorted on. Attempts to sort on an un-sortable field will return the standard error structure with a HTTP 400 status code. (character) A date (character) Date before (character) Date after (character) One of a name of a language, or an ISO-639 code. Codes are included in this package, see language_codes. Find out more at http://www-01. sil.org/iso639-3/default.asp page_size (integer) Number of items to return, defaults to 100. Max of 500. page facets (integer) Page number to return, defaults to NULL. (character) Fields to facet on. facet_size (integer) Default to 100, maximum 2000. key what (character) Your DPLA API key. See dpla_get_key() (character) One of list or table (data.frame). (Default: table)... Curl options passed on to crul::httpclient() Note that parsing of results right now can lead to multiple rows per record because sometimes an array of length > 1 for a result makes a data.frame of more than one row per record. Thus, you will get duplicated values in the id column of the results.

10 dpla_items Value A list of length three: meta - metadata for the call, with one row and three columns: found - number of records found matching criteria start - offset from record 1 returned - number of records returned data - tibble (data.frame) of results facets - list of same length as number of facets requested, each with a list of length two with a meta tibble/data.frame, and a data tibble/data.frame Examples ## Not run: # Basic search, "fruit" in any fields dpla_items(q="fruit") # Limit records returned dpla_items(q="fruit", page_size=2) # Return certain fields dpla_items(q="fruit", fields=c("id","publisher","format")) dpla_items(q="fruit", fields="subject") # Max is 500 per call, but you can use combo of page_size and page params dpla_items(q="fruit", fields="id", page_size=500)$meta$returned lapply(1:2, function(x) { dpla_items(q="fruit", fields="id", page_size=500, page=x)$meta$returned }) out <- lapply(1:2, function(x) dpla_items(q="fruit", fields="id", page_size=500, page=x)) lapply(out, function(y) head(y$data)) # Search by date out <- dpla_items(q="science", date_before=1900, page_size=200) out$data # Search by various fields dpla_items(description="obituaries", page_size=2, fields="description") dpla_items(title="obituaries", page_size=2, fields="title") dpla_items(subject="yodeling", page_size=2, fields="subject") dpla_items(creator="holst-van der Schalk", page_size=2, fields="creator") dpla_items(type="text", page_size=2, fields="type") dpla_items(publisher="leningrad", page_size=2, fields="publisher") dpla_items(rights="unrestricted", page_size=2, fields="rights") dpla_items(provider="hathitrust", page_size=2, fields="provider") ## don't seem to work # dpla_items(contributor="smithsonian", page_size=2, fields="contributor") # dpla_items(format="electronic resource", page_size=2, fields="format")

language_codes 11 # Spatial search ## sp searches all spatial fields, or search on specific fields, see those ## params with sp_* dpla_items(sp='boston', page_size=2) dpla_items(sp_state='hawaii', page_size=2) dpla_items(sp_state='massachusetts OR Hawaii', page_size=2) dpla_items(sp_coordinates='40,-100', page_size=2) dpla_items(sp_country='canada', page_size=2) dpla_items(sp_county='sacramento', page_size=2) # Language search dpla_items(language='russian')$meta dpla_items(language='rus')$meta dpla_items(language='english')$meta # Sorting dpla_items(fields=c("id","title"), page_size=10) dpla_items(fields=c("id","title"), page_size=10, sort_by="sourceresource.title") # Faceting dpla_items(facets="sourceresource.format", page_size=0) dpla_items(facets="sourceresource.format", page_size=0, facet_size=5) ids <- c("sourceresource.spatial.state","sourceresource.spatial.country") dpla_items(facets=ids, page_size=0) dpla_items(facets="sourceresource.type", page_size=0) #dpla_items(facets="sourceresource.spatial.coordinates:42.3:-71", # page_size=0) #dpla_items(facets="sourceresource.temporal.begin", page_size=0) dpla_items(facets="provider.name", page_size=0) dpla_items(facets="ispartof", page_size=0) dpla_items(facets="hasview", page_size=0) ## End(Not run) language_codes Language codes. A data.frame (7879 rows, 2 columns) containing all language codes. The columns are as follows: id. id (or code) of the language name. longer name of the language

Index Topic datasets country_codes, 2 dpla_fields, 7 language_codes, 11 country_codes, 2, 9 crul::httpclient(), 3, 6, 7, 9 dpla_bulk, 3 dpla_bulk_list (dpla_bulk), 3 dpla_cache, 5 dpla_collections, 6 dpla_fields, 6, 7, 9 dpla_get_key, 7 dpla_get_key(), 2, 6, 9 dpla_items, 8 language_codes, 9, 11 lapply(), 5 rdpla (rdpla-package), 2 rdpla-package, 2 12