vector_to_coord: convert a vector of characters to a vector of numeric...

View source: R/utils.R

vector_to_coordR Documentation

convert a vector of characters to a vector of numeric coordinates

Description

convert a vector of characters to a vector of numeric coordinates

Usage

vector_to_coord(x, scale = NA, range = c(0, 1))

Arguments

x

a vector of characters, which will be coerced into factor.

scale

a vector of length(x) - 1 numeric values to control adjacent spacing. Set NA or NULL for equally dividing.

range

a vector of 2 numeric values defining a interval, where x will be mapped.

Value

a vector of length(x)

Examples

vector_to_coord(1:4, scale = c(2,2,2), range(1, 9))


zzwch/crosslink documentation built on Aug. 27, 2023, 5:57 p.m.