format_scale: Rescale data

View source: R/format_scale.r

format_scaleR Documentation

Rescale data

Description

Rescale data to have a new range.

Usage

format_scale(x, new_min = 0, new_max = 1)

Arguments

x

A numeric vector

new_min

A numeric single value (default = 0), that will be the new minimum value

new_max

A numeric single value (default = 1), that will be the new maximum value

Value

A numeric vector.

Examples


x <- seq(-3,3,l = 100)

range(x)

y <- format_scale(x)

range(y)

plot(x,y)


vbfelix/relper documentation built on Jan. 28, 2025, 12:15 p.m.