subject | R Documentation |
Create/add/retrieve a subject
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 |
The URI of the subject identifier scheme, for example
|
valueURI |
The URI of the subject term.
|
prefix |
An abbreviated prefix of a scheme URI, for example,
|
subjectScheme |
The name of the subject scheme or classification code or authority if one is used. It is a namespace. |
classificationCode |
The classificationCode subproperty may be used for subject schemes, like ANZSRC, which do not have valueURIs for each subject term. |
value |
A subject field created by |
The subject class and its function record the subject property of the dataset.
The DataCite definition allows the use of multiple subproperties, however, these
cannot be added to the standard utils::bibentry
object. Therefore, if the user sets the value of the subject field to a
character string, it is added to the bibentry of the dataset, and also to
a separate subject
attribute. If the user wants to use the more detailed
subproperties (see examples with subject_create
), then the subject$term
value is added to the bibentry as a text, and the more complex subject object
is added as a separate attribute to the dataset_df object.#'
subject(x)
returns the subject attribute of the
dataset_df
object x
, subject(x)<-value
sets
the same attribute to value
and invisibly returns the x
object with
the changed attributes.
A subject_create
returns a named list with the subject term,
the subject scheme, URIs and prefix.
is.subject
returns a logical value, TRUE
if the subject as a list
is well-formatted by subject_create
with its necessary key-value pairs.
# To set the subject of a dataset_df object:
subject(iris_dataset) <- subject_create(
term = "Irises (plants)",
schemeURI = "http://id.loc.gov/authorities/subjects",
valueURI = "https://id.loc.gov/authorities/subjects/sh85068079",
subjectScheme = "LCCH",
prefix = "lcch:")
# To retrieve the subject with its subproperties:
subject(iris_dataset)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.