# Set ORDER for a variable
library(tibble)
x1 <-
population_gl |>
px() |>
px_order(tribble(~`variable-code`, ~order,
'gender', 8))
# Print ORDER
px_order(x1)
# Set ORDER for a value
x2 <-
x1 |>
px_order(tribble(~`variable-code`, ~code, ~order,
'age', '2004', 9))
px_order(x2)
# Remove ORDER
x3 <- px_order(x2, NULL)
px_order(x3)
Run the code above in your browser using DataLab