set_mw<- {optimall} | R Documentation |
Write Slots of a Multiwave Object
Description
set_mw
is used to assign values (write to) slots of
Multiwave
class objects. It is used to set values of
multiwave (mw) objects.
Usage
set_mw(
x,
phase = 1,
wave = NA,
slot = c("data", "design", "metadata", "samples", "sampled_data")
) <- value
Arguments
x |
an object of class |
phase |
a numeric value specifying the phase that should be accessed.
To access the overall metadata, set |
wave |
a numeric value specifying the wave that should be accessed.
Ta access phase metadata, set |
slot |
a character value specifying the name of the slot to be
accessed. Must be one of |
value |
value to assign to specified slot |
Examples
# Intiate multiwave object
MySurvey <- multiwave(phases = 2, waves = c(1, 3))
# To write overall metadata
set_mw(MySurvey, phase = NA, slot = "metadata") <-
list(title = "Maternal Weight Survey")
# To write Phase 2 metadata
set_mw(MySurvey, phase = 2, slot = "metadata") <-
list(strata = "mystrata", id = "id")
[Package optimall version 1.1.1 Index]