R/normalize_roles.R

Defines functions normalize_roles

#' @keywords internal

normalize_roles <- function(people, default_role = "ctb") {
  lapply(people, function(p) {
    if (!inherits(p, "person")) {
      return(p)
    }
    if (is.null(p$role) || !any(nzchar(p$role))) {
      p$role <- default_role
    }
    p
  })
}

Try the dataset package in your browser

Any scripts or data that you put into this service are public.

dataset documentation built on June 8, 2025, 10:15 a.m.