sort_val_labels: Sort value labels

View source: R/val_labels.R

sort_val_labelsR Documentation

Sort value labels

Description

Sort value labels according to values or to labels

Usage

sort_val_labels(x, according_to = c("values", "labels"), decreasing = FALSE)

Arguments

x

A labelled vector or a data.frame

according_to

According to values or to labels?

decreasing

In decreasing order?

Examples

v <- labelled(c(1, 2, 3), c(maybe = 2, yes = 1, no = 3))
v
sort_val_labels(v)
sort_val_labels(v, decreasing = TRUE)
sort_val_labels(v, "l")
sort_val_labels(v, "l", TRUE)

labelled documentation built on May 29, 2024, 9:34 a.m.