Learn R Programming

egor (version 1.25.10)

ego_design: Set and query the ego sampling design

Description

Extract, set, remove, or update the survey design associated with an ego-centered dataset.

Usage

ego_design(x, ...)

# S3 method for egor ego_design(x, ...)

# S3 method for nested_egor ego_design(x, ...)

ego_design(x, ...) <- value

# S3 method for egor ego_design(x, ...) <- value

# S3 method for nested_egor ego_design(x, ...) <- value

has_ego_design(x)

# S3 method for egor has_ego_design(x)

# S3 method for nested_egor has_ego_design(x)

strip_ego_design(x)

Arguments

x

an egor object.

...

arguments to be passed to methods

value

A list of arguments to srvyr::as_survey_design() specifying the sampling design for the egos in terms of the ego variables. Variable names can be referenced as strings, as one-sided formulas, or using dplyr::select() syntax. It is recommended to use alist() rather than list() to construct this argument, particularly when using the select() syntax. Pass NULL to set no design.

Examples

Run this code
data(egor32)

ego_design(egor32)

ego_design(egor32) <- alist(strata = sex)

ego_design(egor32)

Run the code above in your browser using DataLab