get_label: Get a private field from a Survey object.

Description Usage Arguments Author(s) Examples

View source: R/accessors.R

Description

The listed functions provide a familiar interface to the hidden fields of a Survey object. Each returns a named vector with the corresponding values.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11

Arguments

.srv

A Survey object.

which

If this is specified, the function only returns the elements which match the criteria. This should be a character vector.

invert

For get_association the default output is returned with the association as a name and variable names as the values. Set to FALSE to override.

Author(s)

Kristian D. Olsen

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Create a new survey (regular)
x <- survey_df(data.frame("A" = 1, "B" = 2))
x <- set_label(x, A = "This is a label")
get_label(x, "A")

# Same example using R6
y <- survey_df(data.frame("A" = 1, "B" = 2))
y$set_label(A = "This is a label")
y$get_label("A")

# Should be equivalent
all.equal(x, y)

itsdalmo/reporttoolDT documentation built on May 18, 2019, 7:11 a.m.