Learn R Programming

volker (version 2.1.0)

get_direction: Detect whether a scale is a numeric sequence

Description

From all values in the selected columns, the numbers are extracted. If no numeric values can be found, returns 0. Otherwise, if any positive values form an ascending sequence, returns -1. In all other cases, returns 1.

Usage

get_direction(data, cols, extract = TRUE)

Value

0 = an undirected scale, -1 = descending values, 1 = ascending values.

Arguments

data

The dataframe.

cols

The tidy selection.

extract

Whether to extract numeric values from characters.