set_license: Set, create or modify columns with license and rights...

View source: R/set_license.R

set_licenseR Documentation

Set, create or modify columns with license and rights information

Description

Format fields that contain information on permissions for use, sharing or access to a record to a tibble using Darwin Core Standard.

In practice this function is no different from using mutate(), but gives some informative errors, and serves as a useful lookup for fields in the Darwin Core Standard.

Usage

set_license(
  .df,
  license = NULL,
  rightsHolder = NULL,
  accessRights = NULL,
  .keep = "unused"
)

Arguments

.df

A data.frame or tibble that the column should be appended to.

license

A legal document giving official permission to do something with the resource. Must be provided as a url to a valid license.

rightsHolder

Person or organisation owning or managing rights to resource.

accessRights

Access or restrictions based on privacy or security.

.keep

Control which columns from .data are retained in the output. Note that unlike dplyr::mutate(), which defaults to "all" this defaults to "unused"; i.e. only keeps Darwin Core columns, and not those columns used to generate them.

Details

Examples of license values:

  • ⁠http://creativecommons.org/publicdomain/zero/1.0/legalcode⁠

  • ⁠http://creativecommons.org/licenses/by/4.0/legalcode⁠

  • CC0

  • ⁠CC-BY-NC 4.0 (Int)⁠

Examples of rightsHolder values:

  • ⁠The Regents of the University of California⁠

Examples of accessRights values:

  • ⁠not-for-profit use only⁠ (string example)

  • ⁠https://www.fieldmuseum.org/field-museum-natural-history-conditions-and-suggested-norms-use-collections-data-and-images⁠ (URI example)

Value

A tibble with the requested fields added/reformatted.

See Also

set_observer() for adding observer information.

Examples

df <- tibble::tibble(
  name = c("Crinia Signifera", "Crinia Signifera", "Litoria peronii"),
  latitude = c(-35.27, -35.24, -35.83),
  longitude = c(149.33, 149.34, 149.34),
  eventDate = c("2010-10-14", "2010-10-14", "2010-10-14"),
  attributed_license = c("CC-BY-NC 4.0 (Int)", "CC-BY-NC 4.0 (Int)", "CC-BY-NC 4.0 (Int)")
  )

# Reformat columns to Darwin Core Standard
df |>
  set_license(
    license = attributed_license
    )


corella documentation built on April 4, 2025, 12:20 a.m.