R/survey.R

Defines functions survey

Documented in survey

#' @title Contact survey
#' @description Deprecated. Use `as_survey` instead.
#' @param participants a `data.frame` containing information on participants
#' @param contacts a `data.frame` containing information on contacts
#' @param reference a `list` containing information needed to
#'   reference the survey, in particular it can contain a "title",
#'   "bibtype", "author", "doi", "publisher", "note", "year"
#' @return a new survey object
#' @author Sebastian Funk
#' @export
survey <- function(participants, contacts, reference = NULL) {
  lifecycle::deprecate_warn(
    "1.0.0",
    "survey()",
    details = "Use `as_contact_survey()` instead."
  )
  structure(
    list(
      participants = data.table(participants),
      contacts = data.table(contacts),
      reference = reference
    ),
    class = "contact_survey"
  )
}

Try the socialmixr package in your browser

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

socialmixr documentation built on April 29, 2026, 9:07 a.m.