| Title: | Access Versioned VIRION Data |
|---|---|
| Description: | This package provides an ergonomic interface for accessing the VIRION dataset (https://doi.org/10.5281/zenodo.15643003). |
| Authors: | Collin Schwantes [aut, cre] (ORCID: <https://orcid.org/0000-0002-9882-941X>) |
| Maintainer: | Collin Schwantes <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 1.0.0 |
| Built: | 2026-05-31 07:39:09 UTC |
| Source: | https://github.com/viralemergence/virionData |
This is 'download_deposit_version' wrapped in a 'purr::map' call.
batch_download_deposit_versions(zenodo_ids = "all", dir_path, ...)batch_download_deposit_versions(zenodo_ids = "all", dir_path, ...)
zenodo_ids |
Character. Either a vector of zenodo ids or "all" |
dir_path |
Character. Path to folder where files should be downloaded. |
... |
Other arguments passed to 'download_deposit_version' |
List of download locations.
## Not run: # get all deposit versions batch_download_deposit_versions(dir_path = "outputs") # get select versions batch_download_deposit_versions(zenodo_ids = c("15677137", "15643004"), dir_path = "outputs") ## End(Not run)## Not run: # get all deposit versions batch_download_deposit_versions(dir_path = "outputs") # get select versions batch_download_deposit_versions(zenodo_ids = c("15677137", "15643004"), dir_path = "outputs") ## End(Not run)
Simple summary data frame for the deposit
deposit_summary()deposit_summary()
data frame. Simplified deposit metadata with the following fields: * id = zenodo id * latest_version = True or False indicating if that record is the latest version of the dataset. * publication_date = YMD the item was published to zenodo * doi_url = digital object identifier for that version of the record.
deposit_summary()deposit_summary()
Downloads and extracts some version of the deposit.
download_deposit_version( zenodo_id, deposit_versions = list_deposit_versions(), dir_path, datapackage_only = FALSE )download_deposit_version( zenodo_id, deposit_versions = list_deposit_versions(), dir_path, datapackage_only = FALSE )
zenodo_id |
String. ID for a Zenodo deposit. Should correspond to the version of a deposit. |
deposit_versions |
data frame. Output from 'list_deposit_versions' |
dir_path |
String. Path to directory where the files should be downloaded e.g. "inst/extdata/wdds_archive" note no trailing slash on the path. |
datapackage_only |
Logical. Download only the datapackage.json file |
String. Path to downloaded version.
Bibtex specific wrapper for export_deposit_metadata
export_deposit_bibtex(zenodo_id = the$working_version, verbose = TRUE)export_deposit_bibtex(zenodo_id = the$working_version, verbose = TRUE)
zenodo_id |
String. ID for a Zenodo deposit. Should correspond to the version of a deposit. |
verbose |
Logical. Print the formatted metadata? |
Character. bibtex formatted entry
## Not run: export_deposit_bibtex(zenodo_id = "15692263" ) |> writeLines(con = "outputs/citation.bib") ## End(Not run)## Not run: export_deposit_bibtex(zenodo_id = "15692263" ) |> writeLines(con = "outputs/citation.bib") ## End(Not run)
Export Deposit Metadata in various formats
export_deposit_metadata( zenodo_id = the$working_version, format, verbose = TRUE )export_deposit_metadata( zenodo_id = the$working_version, format, verbose = TRUE )
zenodo_id |
String. ID for a Zenodo deposit. Should correspond to the version of a deposit. |
format |
String. File format for export. One of "json", "json-ld","csl","datacite-json","datacite-xml", "dublincore","marcxml","bibtex","geojson","dcat-ap","codemeta", or "cff" |
verbose |
Logical. Print the formatted metadata? |
Character. Returns text in selected format.
## Not run: export_deposit_metadata(zenodo_id = "15692263","json-ld" ) |> writeLines(con = "outputs/citation.jsonld") ## End(Not run)## Not run: export_deposit_metadata(zenodo_id = "15692263","json-ld" ) |> writeLines(con = "outputs/citation.jsonld") ## End(Not run)
Creates a list of data frames that constitutes the data dictionary.
get_data_dictionary(datapackage_json)get_data_dictionary(datapackage_json)
datapackage_json |
Character. Path to datapackage.json file |
List. Named list of data frames with the following fields: * name = field name * type = field type * description = characterization of the field
## Not run: get_data_dictionary(datapackage_json = "data/1235600/datapackage.json") ## End(Not run)## Not run: get_data_dictionary(datapackage_json = "data/1235600/datapackage.json") ## End(Not run)
Get the dictionary for a single resource
get_individual_dictionary(x)get_individual_dictionary(x)
x |
List. Resource object from the data package. |
dataframe with three fields.
Get the name of a resource
get_resource_name(x)get_resource_name(x)
x |
data frame with name field |
character. Name of resources
Get Version Citation
get_version_citation( zenodo_id = the$working_version, style = c("havard-cite-them-right", "apa", "modern-language-association", "vancouver", "chicago-fullnote-bibliography", "ieee"), verbose = TRUE )get_version_citation( zenodo_id = the$working_version, style = c("havard-cite-them-right", "apa", "modern-language-association", "vancouver", "chicago-fullnote-bibliography", "ieee"), verbose = TRUE )
zenodo_id |
String. ID for a Zenodo deposit. Should correspond to the version of a deposit. |
style |
Character. One of "havard-cite-them-right", "apa", "modern-language-association", "vancouver", "chicago-fullnote-bibliography", or "ieee" |
verbose |
Logical. Print the citation? |
Character. Text for a citation
## Not run: get_version_citation(zenodo_id = "15692263", style = "apa") ## End(Not run)## Not run: get_version_citation(zenodo_id = "15692263", style = "apa") ## End(Not run)
This is a convenience function that downloads a specific version of the data and returns attribution information.
get_versioned_data( version = "latest", style = "apa", dir_path, refresh_deposits_versions = TRUE, verbose = TRUE, ... )get_versioned_data( version = "latest", style = "apa", dir_path, refresh_deposits_versions = TRUE, verbose = TRUE, ... )
version |
Character. identifier for a version e.g. "15643003" or "latest" |
style |
Charater. Character. One of "havard-cite-them-right", "apa", "modern-language-association", "vancouver", "chicago-fullnote-bibliography", or "ieee" |
dir_path |
Character. Path to folder where files should be downloaded. |
refresh_deposits_versions |
Logical. Should the function check for new versions of the deposit? |
verbose |
Logical. Include print statements? |
... |
Additional arguments to pass to 'download_deposit_version' |
If you would like to download a bibtex entry use 'export_deposit_bibtex'. For other metadata types (CSL, CFF, JSON-LD, etcetera) use 'export_deposit_metadata'.
Character. path to versioned data.
This function gets the metadata for all the versions of a deposit associated with a parent id. The parent id is used to identify a set of works that are different versions of the same work. The parent id is provided by the Zenodo API. To find the parent ID, download a JSON representation of the deposit (export to json on the webpage or use 'export_deposit_metadata'), there will be an attribute called parent that looks like "https://zenodo.org/api/records/15020049". The 8 digit string at the end of the url is the parent id.
list_deposit_versions(parent_id = "15643003")list_deposit_versions(parent_id = "15643003")
parent_id |
String. Identifier for a Zenodo deposit with multiple versions. |
This function also sets package variables
Data frame. Invisible. The data frame contains the Zenodo id for each version of the deposit, as well as the version name, and logical field called latest that indicates if this is the latest version.
Checks that version ids are properly formatted. IDs should either be integers ("15643003") OR "latest"
sanitize_version(version)sanitize_version(version)
version |
Character. Version identifier. |
Character. Version identifier from Zenodo.
sanitize_version("latest") sanitize_version(" 15643003")sanitize_version("latest") sanitize_version(" 15643003")