R/survey_id.R

Defines functions survey_id

#' Retrieve the operational survey identifier
#'
#' Retrieve the identifier used in survey harmonization workflows.
#' Both legacy `survey` and newer `survey_df` objects store
#' this identifier in the `id` attribute.
#'
#' @param x A survey or survey_df object.
#'
#' @return A character scalar containing the survey identifier,
#'   or `NULL` if the attribute is absent.
#'
#' @keywords internal
#' @noRd
survey_id <- function(x) {
  attr(x, "id", exact = TRUE)
}

Try the retroharmonize package in your browser

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

retroharmonize documentation built on Nov. 29, 2026, 5:06 p.m.