Skip to contents

Inspect or change STUB.

Usage

px_stub(x, value)

# S3 method for class 'px'
px_stub(x, value)

Arguments

x

A px object

value

Optional. A character vector of variable names to change to STUB. This also changes the STUB order. With names in variables becoming 1, 2, ... If missing, the current STUB variables are returned.

Value

A px object or a character vector.

Examples

x1 <- px(population_gl)
# Print STUB
px_stub(x1)
#> [1] "gender" "age"   
# Add 'year' to STUB
x2 <- px_stub(x1, 'year')
px_stub(x2)
#> [1] "year"   "gender" "age"   

# Change order of STUB
x3 <- px_stub(x2, c('age', 'gender'))
px_stub(x3)
#> [1] "age"    "gender" "year"