Learn R Programming

codemetar (version 0.1.8)

crosswalk: Crosswalk

Description

Crosswalk between different metadata fields used by different repositories, registries and archives. For more details see https://codemeta.github.io/crosswalk This function requires an internet connection to obtain the latest crosswalk table. This function essentially applies the crosswalk table shown by crosswalk_table to a given JSON metadata record.

Usage

crosswalk(x, from, to = "codemeta", codemeta_context = NULL)

Arguments

x

a JSON list or file with data fields to be crosswalked

from

the corresponding column name from the crosswalk table.

to

the column to translate into, assumes "codemeta" by default

codemeta_context

the address or contents of codemeta context. If not specified, the default "https://doi.org/10.5063/schema/codemeta-2.0" is used. The default is taken from the option "codemeta_context" and can thus be overridden by setting this option with options(codemeta_context = <your_context_url>).

Value

a `json` object containing a valid codemeta.json file created by crosswalking the input JSON

Examples

Run this code
# NOT RUN {
## Crosswalk data returned by the GitHub API into CodeMeta format
r <- gh::gh("/repos/:owner/:repo", owner = "ropensci", repo = "EML")
crosswalk(r, "GitHub")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab