stdz: Standardize Values

stdzR Documentation

Standardize Values

Description

Standardizes values by subtracting the mean and dividing by the standard deviation.

Standardizes values by subtracting the mean and dividing by the standard deviation.

Usage

stdz(object, na.rm = TRUE)

stdz(object, na.rm = TRUE)

## S4 method for signature 'numeric'
stdz(object, na.rm = TRUE)

## S4 method for signature 'matrix'
stdz(object, na.rm = TRUE)

## S4 method for signature 'array'
stdz(object, na.rm = TRUE)

## S4 method for signature 'FLQuant'
stdz(object, na.rm = TRUE)

Arguments

na.rm

Logical indicating whether to remove NA values when computing statistics

x

A numeric vector, matrix, array or FLQuant

Details

Standardization follows the formula: (x - mean(x))/sd(x)

Standardization follows the formula: (x - mean(x))/sd(x)

Value

An object of the same class as the input with standardized values

An object of the same class as the input with standardized values

Examples

## Not run: 
# For numeric vector
x <- 1:10
stdz(object)

# For FLQuant
data(ple4)
standardized_catch <- stdz(catch(ple4))

## End(Not run)

## Not run: 
# For numeric vector
x <- 1:10
stdz(object)

# For FLQuant
data(ple4)
standardized_catch <- stdz(catch(ple4))

## End(Not run)


laurieKell/FLCandy documentation built on April 17, 2025, 5:23 p.m.