Learn R Programming

moderndive (version 0.7.0)

pop_sd: Calculate Population Standard Deviation

Description

This function calculates the population standard deviation for a numeric vector.

Usage

pop_sd(x)

Value

A numeric value representing the population standard deviation of the vector.

Arguments

x

A numeric vector for which the population standard deviation should be calculated.

Examples

Run this code
# Example usage:
library(dplyr)
df <- data.frame(weight = c(2, 4, 6, 8, 10))
df |> 
  summarize(population_mean = mean(weight), 
            population_sd = pop_sd(weight))

Run the code above in your browser using DataLab