Skip to contents

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.

Value

A tibble with the requested fields added/reformatted.

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)

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
    )
#> ⠙ Checking 1 column: license
#>  Checking 1 column: license [310ms]
#> 
#> # A tibble: 3 × 5
#>   name             latitude longitude eventDate  license           
#>   <chr>               <dbl>     <dbl> <chr>      <chr>             
#> 1 Crinia Signifera    -35.3      149. 2010-10-14 CC-BY-NC 4.0 (Int)
#> 2 Crinia Signifera    -35.2      149. 2010-10-14 CC-BY-NC 4.0 (Int)
#> 3 Litoria peronii     -35.8      149. 2010-10-14 CC-BY-NC 4.0 (Int)