This repository has been archived by the owner on Sep 9, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
93 changed files
with
4,977 additions
and
425 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,4 @@ Makefile | |
inst/vign/ | ||
vignettes/rbhl_vignette.md | ||
vignettes/margins.sty | ||
vignettes/cache/ | ||
vignettes/cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
YEAR: 2013 | ||
COPYRIGHT HOLDER: Scott Chamberlain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#' Return a list of parts (articles, chapters, etc) associated with a given BHL | ||
#' author identifier. Unless the identifier for a particular BHL author record | ||
#' is known in advance, this method should be used in combination with the | ||
#' AuthorSearch method. | ||
#' | ||
#' Note: haven't seen examples for this function that work yet... | ||
#' | ||
#' @import httr | ||
#' @importFrom plyr compact | ||
#' @importFrom XML xmlTreeParse | ||
#' @template all | ||
#' @param creatorid BHL identifier for a particular author (numeric) | ||
#' @examples \dontrun{ | ||
#' bhl_getauthorparts(147) | ||
#' bhl_getauthorparts(39120, output='raw') | ||
#' bhl_getauthorparts(39120, format='xml', output='raw') | ||
#' bhl_getauthorparts(39120, format='xml', output='parsed') | ||
#' } | ||
#' @export | ||
bhl_getauthorparts <- function(creatorid, format = "json", output='list', | ||
key = NULL, callopts=list()) | ||
{ | ||
if(output=='list') format='json' | ||
key <- getkey(key) | ||
url = "http://www.biodiversitylibrary.org/api2/httpquery.ashx" | ||
args <- compact(list(op = "GetAuthorParts", apikey = key, format = format, | ||
creatorid=creatorid)) | ||
out <- GET(url, query = args, callopts) | ||
stop_for_status(out) | ||
tt <- content(out, as="text") | ||
return_results(tt, output, format) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#' Return a list of an item's parts. | ||
#' | ||
#' @import httr | ||
#' @importFrom plyr compact | ||
#' @importFrom XML xmlTreeParse | ||
#' @template all | ||
#' @param itemid the item id (character) | ||
#' @examples \dontrun{ | ||
#' bhl_getitemparts(35600) | ||
#' bhl_getitemparts(35600, 'xml', 'raw') | ||
#' bhl_getitemparts(35600, 'xml', 'parsed') | ||
#' } | ||
#' @export | ||
bhl_getitemparts <- function(itemid, format = "json", output='list', | ||
key = NULL, callopts = list()) | ||
{ | ||
if(output=='list') format='json' | ||
key <- getkey(key) | ||
url = "http://www.biodiversitylibrary.org/api2/httpquery.ashx" | ||
args <- compact(list(op = "GetItemParts", apikey = key, format = format, | ||
itemid=itemid)) | ||
out <- GET(url, query = args, callopts) | ||
stop_for_status(out) | ||
tt <- content(out, as="text") | ||
return_results(tt, output, format) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.