Skip to contents

The value returned by sf_items(), sf_scales(), sf_choice_sets(), sf_branches(), sf_checks() and sf_models(). It is a list of component objects named by their IDs, so a single component is reached with [[.

Usage

# S3 method for class 'sf_component_list'
print(x, ...)

# S3 method for class 'sf_component_list'
x[i, ...]

Arguments

x

An sf_component_list.

...

Ignored. Present for S3 consistency.

i

Index, name, or logical vector selecting components.

Value

print() returns x invisibly. [ returns an sf_component_list.

Examples

item1 <- sf_item("q1", "First question", type = "text")
item2 <- sf_item("q2", "Second question", type = "text")
instr <- sf_instrument("Demo", components = list(item1, item2))

sf_items(instr)
#> <item list: 2>
#>  <sf_item: q1 | type: text>
#>  <sf_item: q2 | type: text>
sf_items(instr)[["q2"]]
#> <sf_item: q2 | type: text>
#>   Label: Second question