rescale_vector: Rescales a numeric vector into a new range

View source: R/rescale_vector.R

rescale_vectorR Documentation

Rescales a numeric vector into a new range

Description

Rescales a numeric vector to a new range.

Usage

rescale_vector(
  x = NULL,
  new.min = 0,
  new.max = 1,
  integer = FALSE
)

Arguments

x

Numeric vector. Default: NULL

new.min

New minimum value. Default: 0

new.max

New maximum value. Default: 1

integer

Logical, if TRUE, coerces the output to integer. Default: FALSE

Value

A numeric vector of the same length as x, but with its values rescaled between new.min and new.max.

See Also

Other utilities: .vif_to_df(), auc(), beowulf_cluster(), objects_size(), optimization_function(), prepare_importance_spatial(), root_mean_squared_error(), setup_parallel_execution(), standard_error(), statistical_mode(), thinning(), thinning_til_n()

Examples


y <- rescale_vector(
  x = rnorm(100),
  new.min = 0,
  new.max = 100,
  integer = TRUE
)
y


spatialRF documentation built on Dec. 20, 2025, 1:07 a.m.