Learn R Programming

dataset (version 0.4.1)

dataset_title: Get or Set the Title of a Dataset

Description

Retrieve or assign the main title of a dataset, typically used as the primary label in metadata exports (e.g., DataCite or Dublin Core).

Usage

dataset_title(x)

dataset_title(x, overwrite = FALSE) <- value

Value

dataset_title() returns the current dataset title as a character string. dataset_title<-() returns the updated dataset object (invisible).

Arguments

x

A dataset object created by dataset_df() or as_dataset_df().

overwrite

Logical. If TRUE, the existing title is replaced. If FALSE (default) and a title is already present, a warning is issued and the title is not changed.

value

A character string representing the new title. If NULL, a placeholder value ":tba" is assigned. If value is a character vector of length > 1, an error is raised.

Details

According to the Dublin Core specification for title, the title represents the name by which the resource is formally known.

The DataCite metadata schema supports multiple titles (e.g., translated, alternative), but this function currently supports only a single main title.

See Also

Other bibliographic helper functions: contributor(), creator(), dataset_format(), description(), geolocation(), get_bibentry(), language, publication_year(), publisher(), relation(), rights(), subject()

Examples

Run this code
dataset_title(orange_df)

# Set a new title with overwrite = TRUE
dataset_title(orange_df, overwrite = TRUE) <- "The Growth of Orange Trees"
dataset_title(orange_df)

Run the code above in your browser using DataLab