View source: R/modify_cells1.R
px_order | R Documentation |
Inspect or change ORDER.
px_order(x, value, validate)
## S3 method for class 'px'
px_order(x, value, validate = TRUE)
x |
A px object |
value |
Optional. A data frame with the columns 'order' and one or more of the columns: 'variable-code', and 'code'. If 'value' is missing, the current ORDER is returned. If NULL, ORDER is removed. |
validate |
Optional. If TRUE a number of validation checks are performed on the px object, and an error is thrown if the object is not valid. If FALSE, the checks are skipped, which can be usefull for large px objects where the check can be time consuming. Use |
A px object or data frame.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.