survey: Create a survey data frame

View source: R/survey.R

surveyR Documentation

Create a survey data frame

Description

Store survey data in a tibble with a unique survey identifier, source filename, and optional digital object identifier (DOI).

Usage

survey(object = data.frame(), id = "survey_id", filename = NULL, doi = NULL)

is.survey(object)

## S3 method for class 'survey'
summary(object, ...)

Arguments

object

A data frame or tibble containing the survey data.

id

A unique identifier for the survey.

filename

The name of the source file.

doi

An optional digital object identifier (DOI).

...

Arguments passed to summary method.

Details

Survey objects can be created directly with this constructor. More commonly, they are created by the import functions [read_rds()], [read_spss()], [read_dta()], and [read_csv()], or through the common import interface [read_surveys()].

Value

A tibble of class 'survey' with survey-level metadata stored in the 'id', 'filename', and 'doi' attributes.

See Also

Other importing functions: is.survey_df()

Examples

example_survey <- survey(
  object = data.frame(
    rowid = 1:6,
    observations = runif(6)
  ),
  id = "example",
  filename = "no_file"
)

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