Skip to content

Instantly share code, notes, and snippets.

@SimonGoring
Last active April 29, 2024 16:55
Show Gist options
  • Save SimonGoring/4a0b09b83373791a92c28b7191d07000 to your computer and use it in GitHub Desktop.
Save SimonGoring/4a0b09b83373791a92c28b7191d07000 to your computer and use it in GitHub Desktop.
A GIST to show how to cite Neotoma datasets, including DOIs, when dataset IDs have been provided.
# Pollen records citation script:
# By: Simon J. Goring
# April 29, 2024
#
# The file "pollen_counts_europe.csv" is part of the PANGEA Package
# associated with LegacyPollen v1.0 (https://doi.org/10.1594/PANGAEA.929773)
# While it is possible to write a script that pulls each zip file down using
# the DOI, here we assume an individual file is directly available in the
# working directory.
# Note that while the files in the PANGEA repository are identified using the
# `csv` extension, it appears that they are tab separated files (thus the use
# of the `read_tsv()` function from `readr`.
library(neotoma2)
library(dplyr)
library(readr)
poll <- readr::read_tsv('pollen_counts_europe.csv') %>%
dplyr::filter(Data_Source == 'Neotoma') %>%
dplyr::select(Dataset_ID) %>%
dplyr::distinct() %>%
unlist()
# Note that by default the `neotoma2` R package returns only
# 25 records, to avoid overloading either the user's memory,
# or the Neotoma API. Using the `all_data = TRUE` flag returns
# the full query set.
datasets <- neotoma2::get_datasets(poll, all_data = TRUE)
# This command prints all DOIs and a partial data citation for each
# dataset returned in the `datasets` list.
neotoma2::doi(datasets)
Copyright 2024, Simon James Goring
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment