get_bibentry: Get or set the bibentry

View source: R/get_bibentry.R

get_bibentryR Documentation

Get or set the bibentry

Description

Retrieve or replace the bibliographic entry stored in a dataset's attributes. The entry is a utils::bibentry used to hold citation metadata for dataset_df() objects.

Usage

get_bibentry(dataset)

set_bibentry(dataset) <- value

Arguments

dataset

A dataset created with dataset_df().

value

A utils::bibentry to store on the dataset. If NULL, a minimal default entry is created.

Details

New datasets are initialized with reasonable defaults. To build a new bibentry with sensible defaults and field names, use datacite() (DataCite) or dublincore() (Dublin Core), then assign it with set_bibentry(dataset) <- value.

See the vignette for more background: vignette("bibentry", package = "dataset").

Value

  • get_bibentry(dataset) returns the utils::bibentry stored in dataset's attributes.

  • set_bibentry(dataset) <- value sets the attribute and returns the modified dataset invisibly.

See Also

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

Examples

# Get the bibentry of a dataset_df object:
be <- get_bibentry(orange_df)

# Create a well-formed bibentry (DataCite-style):
be2 <- datacite(
  Creator = person("Jane", "Doe"),
  Title = "The Orange Trees Dataset",
  Publisher = "MyOrg"
)

# Assign the new bibentry:
set_bibentry(orange_df) <- be2

# Inspect in different notations:
as_datacite(orange_df, type = "list")
as_dublincore(orange_df, type = "list")


dataset documentation built on Nov. 16, 2025, 5:06 p.m.