Skip to contents

Adds or retrieves the optional "format" field of a dataset's bibentry. This field is the dataset's technical/media type (e.g., a MIME type).

Usage

dataset_format(x)

dataset_format(x, overwrite = FALSE) <- value

Arguments

x

A semantically rich data frame created with dataset_df() or as_dataset_df().

overwrite

Logical. Replace an existing non‑default value? If FALSE and a non‑default value already exists, a message is emitted and the value is kept. Defaults to FALSE.

value

A length‑one character string specifying the format (e.g., "text/csv"). Use NULL to reset to the default.

Value

The "format" (technical format) as a character string (length 1). When assigning, the updated object x is returned invisibly.

Details

The format field corresponds to dct:format in Dublin Core and to format in DataCite. It is useful for indicating serialization such as "text/csv", "application/parquet", or "application/r-rds".

If no format is set, this helper uses the package default "application/r-rds".

See also

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

Examples

dataset_format(orange_df) <- "text/csv"
#> The dataset already has a format: :unas. Use overwrite = TRUE to replace it.
dataset_format(orange_df)
#> [1] ":unas"

# Reset to the package default
dataset_format(orange_df) <- NULL