Skip to contents

Inspect or change HEADING.

Usage

px_heading(x, value)

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

Arguments

x

A px object

value

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

Value

A px object or a character vector.

Examples

x1 <- px(population_gl)

# Print HEADING
px_heading(x1)
#> [1] "year"

# Add 'gender' to HEADING
x2 <- px_heading(x1, 'gender')
px_heading(x2)
#> [1] "gender" "year"  

# Change order of HEADING
x3 <- px_heading(x2, 'year')
px_heading(x3)
#> [1] "year"   "gender"