new_multiwave: Initialize a Multiwave Object

View source: R/new_multiwave.R

new_multiwaveR Documentation

Initialize a Multiwave Object

Description

Creates an Object of Class Multiwave with the specified number of phases and waves. All contents will be NULL upon initialization, but the object contains a framework for contents to be added to during the survey design and sample collection process. Currently, multiwave objects may only have one wave in Phase 1.

Usage

new_multiwave(phases, waves, metadata = list(), phase1 = data.frame())

Arguments

phases

A numeric value specifying the number of phases in the survey design.

waves

A vector of numeric values specifying the number of waves in each phase of the survey design. Length must match the number of phases and the first

metadata

A list containing the survey metadata. Defaults to an empty list.

phase1

A dataframe containing the phase 1 data of the survey. Defaults to an empty dataframe.

Value

Returns an object of class Multiwave that stores all relevant data from the survey design in an organized and easy-to-access manner. See package vignettes or class documentation for more information.

Examples


# Initialize a multiwave object for a two-phase sampling design that will
# sample over three waves in the second phase
multiwave_object <- new_multiwave(phases = 2, waves = c(1, 3))

# If we already have the phase 1 data and want to add a title to the survey
# metadata, we can initialize the object with these included.

library(datasets)
multiwave_object <- new_multiwave(
  phases = 2, waves = c(1, 3),
  metadata = list(title = "my two-phase survey"), phase1 = iris
)

optimall documentation built on Sept. 8, 2023, 6:07 p.m.