View source: R/get_publications.R
| get_publications | R Documentation |
Uses the Neotoma API to search and access information about publications associated with data in the Neotoma Paleoecology Database
get_publications(x = NA, ...)
## Default S3 method:
get_publications(...)
## S3 method for class 'numeric'
get_publications(x, ...)
## S3 method for class 'publication'
get_publications(x, ...)
## S3 method for class 'publications'
get_publications(x, ...)
## S3 method for class 'sites'
get_publications(x, ...)
x |
integer A contact ID |
... |
|
publications object
# How old are the papers in Neotoma that include the term "mammut"?
tryCatch({
mammoth_papers <- get_publications(search="mammut") %>%
as.data.frame()
hist(as.numeric(mammoth_papers$year))
}, error = function(e) {
message("Neotoma server not responding. Try again later.")
})
# We want the paper identified in Neotoma as 666:
tryCatch({
get_publications(666)
}, error = function(e) {
message("Neotoma server not responding. Try again later.")
})
# Take a publication object and purposely degrade the metadata:
tryCatch({
bad_pub <- get_publications(666)
# Note this only changes the reported year, not the citation string.
bad_pub[[1]]@year <- "1923"
bad_pub[[1]]@publicationid <- NA_integer_
updated_pubs <- get_publications(bad_pub[[1]])
attr(updated_pubs, "matches")
# we see the proper citation in the record:
updated_pubs <- attr(updated_pubs, "matches")[[3]]
}, error = function(e) {
message("Neotoma server not responding. Try again later.")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.