knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(dataset) iris_dataset_2 <- iris_dataset
An important aim of the dataset package is to create native R objects where bibliographic metadata cannot be detached, thus ensuring Findability, Accessibility, Interoperability and Reusability in the long run. We provide an interface and methods to add metadata required by open data repositories according to the more general Dublin Core library metadata standard, or the more specific DataCite metadata standard.
print(get_bibentry(iris_dataset_2), "Bibtex")
dataset_title(iris_dataset)
dataset_title(iris_dataset_2, overwrite=TRUE) <- "The Famous Iris Dataset" get_bibentry(iris_dataset_2)
The \code{Creator} corresponds to dct:creator in Dublin Core and Creator in DataCite, the two most important metadata definitions for publishing datasets in repositories. They refer to the The name of the entity that holds, archives, publishes prints, distributes, releases, issues, or produces the dataset. This property will be used to formulate the citation.
creator(iris_dataset)
iris_dataset_2 <- iris_dataset # Add a new creator, with overwriting existing authorship information: creator(iris_dataset_2, overwrite=TRUE) <- person("Jane", "Doe", role = "aut") # Add a new creator, without overwriting existing authorship information: creator(iris_dataset_2, overwrite=FALSE) <- person("John", "Doe", role = "ctb") # The two new creation contributors: creator(iris_dataset_2)
The publication year is usually one of the most important descriptive metadata in repositories and libraries:
publication_year(iris_dataset_2)
The default value is :unas
for unassigned values:
# Revert to default (unassigned): publication_year(iris_dataset_2) <- NULL # Get the default value: publication_year(iris_dataset_2)
# Get the language: language(iris_dataset) # Reset the language: language(iris_dataset_2) <- "French" language(iris_dataset_2)
# Add rights statement to the dataset rights(iris_dataset_2, overwrite = TRUE) <- "GNU-2"
Some metadata functions prevent accidental overwriting, except for the default :unas
unassigned and :tba
to-be-announced values.
rights(iris_dataset_2) <- "CC0" rights(iris_dataset_2)
Overwriting the rights statement needs an explicit approval:
rights(iris_dataset_2, overwrite = TRUE) <- "GNU-2"
DataCite currently allows the use of subproperties. For example, the Creative Commons Attribution 4.0 International would be described as:
list ( schemeURI="https://spdx.org/licenses/", rightsIdentifierScheme="SPDX", rightsIdentifier="CC-BY-4.0", rightsURI="https://creativecommons.org/licenses/by/4.0/")
The use of subproperties will be later implemented.
The description is currently implemented as a character string. However,
DataCite 4.6 states that if Description is used, descriptionType
is mandatory.
This will be implemented later.
<descriptions> <description xml:lang="en" descriptionType="Abstract">Example abstract</description> </descriptions>
description(iris_dataset)
subject(iris_dataset)
<subjects> <subject xml:lang="en" subjectScheme="Library of Congress Subject Headings (LCSH)" schemeURI="https://id.loc.gov/authorities/subjects.html" valueURI="https://id.loc.gov/authorities/subjects/sh2009009655.html">Climate change mitigation</subject> <subject xml:lang="en" subjectScheme="ANZSRC Fields of Research" schemeURI="https://www.abs.gov.au/statistics/classifications/australian-and-new-zealand-standard-research-classification-anzsrc" classificationCode="370201">Climate change processes</subject> </subject>
subject_create( term = "data sets", subjectScheme = "Library of Congress Subject Headings (LCSH)", schemeURI = "https://id.loc.gov/authorities/subjects.html", valueURI = "http://id.loc.gov/authorities/subjects/sh2018002256" )
# Add rights statement to the dataset identifier(iris_dataset_2)
Get the metadata according to the DataCite definition:
print(as_datacite(iris_dataset), "Bibtex")
And according to DCTERMS (Dublin Core):
print(as_dublincore(iris_dataset), "Bibtex")
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.