Learn R Programming

mosaic (version 1.9.1)

zscore: Compute z-scores

Description

Compute z-scores

Usage

zscore(x, na.rm = getOption("na.rm", FALSE))

Arguments

x

a numeric vector

na.rm

a logical indicating whether missing values should be removed

Examples

Run this code
data(penguins, package = "palmerpenguins")
penguins |> 
  group_by(species) |> 
  mutate(zbill_length_mm = zscore(bill_length_mm, na.rm = TRUE)) |> 
  head()

Run the code above in your browser using DataLab