Package 'virionData'

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

Help Index


Batch download deposit versions

Description

This is 'download_deposit_version' wrapped in a 'purr::map' call.

Usage

batch_download_deposit_versions(zenodo_ids = "all", dir_path, ...)

Arguments

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'

Value

List of download locations.

Examples

## 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

Description

Simple summary data frame for the deposit

Usage

deposit_summary()

Value

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.

Examples

deposit_summary()

Download deposit version

Description

Downloads and extracts some version of the deposit.

Usage

download_deposit_version(
  zenodo_id,
  deposit_versions = list_deposit_versions(),
  dir_path,
  datapackage_only = FALSE
)

Arguments

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

Value

String. Path to downloaded version.


Get bibtex entry for a deposit.

Description

Bibtex specific wrapper for export_deposit_metadata

Usage

export_deposit_bibtex(zenodo_id = the$working_version, verbose = TRUE)

Arguments

zenodo_id

String. ID for a Zenodo deposit. Should correspond to the version of a deposit.

verbose

Logical. Print the formatted metadata?

Value

Character. bibtex formatted entry

Examples

## Not run: 
export_deposit_bibtex(zenodo_id = "15692263" ) |>
  writeLines(con = "outputs/citation.bib")

## End(Not run)

Export Deposit Metadata in various formats

Description

Export Deposit Metadata in various formats

Usage

export_deposit_metadata(
  zenodo_id = the$working_version,
  format,
  verbose = TRUE
)

Arguments

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?

Value

Character. Returns text in selected format.

Examples

## Not run: 
export_deposit_metadata(zenodo_id = "15692263","json-ld" ) |>
  writeLines(con = "outputs/citation.jsonld")

## End(Not run)

Get Data Dictionary for a data Package

Description

Creates a list of data frames that constitutes the data dictionary.

Usage

get_data_dictionary(datapackage_json)

Arguments

datapackage_json

Character. Path to datapackage.json file

Value

List. Named list of data frames with the following fields: * name = field name * type = field type * description = characterization of the field

Examples

## Not run: 
get_data_dictionary(datapackage_json = "data/1235600/datapackage.json")

## End(Not run)

Get the dictionary for a single resource

Description

Get the dictionary for a single resource

Usage

get_individual_dictionary(x)

Arguments

x

List. Resource object from the data package.

Value

dataframe with three fields.


Get the name of a resource

Description

Get the name of a resource

Usage

get_resource_name(x)

Arguments

x

data frame with name field

Value

character. Name of resources


Get Version Citation

Description

Get Version Citation

Usage

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
)

Arguments

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?

Value

Character. Text for a citation

Examples

## Not run: 
get_version_citation(zenodo_id = "15692263",
                    style = "apa")

## End(Not run)

Get a specific version of the data

Description

This is a convenience function that downloads a specific version of the data and returns attribution information.

Usage

get_versioned_data(
  version = "latest",
  style = "apa",
  dir_path,
  refresh_deposits_versions = TRUE,
  verbose = TRUE,
  ...
)

Arguments

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'

Details

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'.

Value

Character. path to versioned data.


Get Versions of a Deposit on Zenodo

Description

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.

Usage

list_deposit_versions(parent_id = "15643003")

Arguments

parent_id

String. Identifier for a Zenodo deposit with multiple versions.

Details

This function also sets package variables

Value

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.


Check version ids

Description

Checks that version ids are properly formatted. IDs should either be integers ("15643003") OR "latest"

Usage

sanitize_version(version)

Arguments

version

Character. Version identifier.

Value

Character. Version identifier from Zenodo.

Examples

sanitize_version("latest")
sanitize_version(" 15643003")