| subject | R Documentation |
Manage the subject metadata of a dataset. The subject can be stored as a
simple character term or as a structured object with subproperties created by
subject_create().
subject(x)
subject_create(
term,
schemeURI = NULL,
valueURI = NULL,
prefix = NULL,
subjectScheme = NULL,
classificationCode = NULL
)
subject(x) <- value
is.subject(x)
x |
A dataset object created with |
term |
A subject term, for example |
schemeURI |
URI of the subject identifier scheme, for example
|
valueURI |
URI of the subject term, for example
|
prefix |
Abbreviated prefix for a scheme URI, for example |
subjectScheme |
Name of the subject scheme, classification code, or authority if one is used. This acts as a namespace. |
classificationCode |
Classification code for schemes that do not have
|
value |
A subject object created by |
The subject property records what the dataset is about.
The DataCite subject property
allows multiple subproperties, but these cannot be stored directly in a
standard utils::bibentry object.
Therefore:
If you set a character string as the subject, it is stored in both the
bibentry and the "subject" attribute.
If you set a structured subject (via subject_create()), the $term value
is stored in the bibentry, and the full object is stored in the "subject"
attribute of the dataset_df object.
subject(x) returns:
a single "subject" object if only one is present,
a list of "subject" objects if multiple are present,
otherwise falls back to the plain string from the bibentry.
subject(x) <- value accepts a character vector, a "subject" object, or
a list of "subject" objects, and updates both the bibentry slot and the
"subject" attribute. Returns the dataset invisibly.
subject_create() returns a structured "subject" object — or a list of
them if multiple terms are provided.
is.subject(x) returns TRUE if x inherits from class "subject".
Other bibliographic helper functions:
contributor(),
creator(),
dataset_format(),
dataset_title(),
description(),
geolocation(),
get_bibentry(),
language,
publication_year(),
publisher(),
relation(),
rights()
# Set a structured subject
subject(orange_df) <- subject_create(
term = "Oranges",
schemeURI = "http://id.loc.gov/authorities/subjects",
valueURI = "http://id.loc.gov/authorities/subjects/sh85095257",
subjectScheme = "LCCH",
prefix = "lcch:"
)
# Retrieve subject with subproperties
subject(orange_df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.