Learn R Programming

spectrolab (version 0.0.19)

sd.default: Default standard deviation

Description

sd computes the standard deviation of the values in x. If na.rm is TRUE then missing values are removed before computation proceeds.

Usage

# S3 method for default
sd(x, na.rm = FALSE)

Value

standard deviation of x

Arguments

x

a numeric vector or an R object which is coercible to one by as.double(x)

na.rm

logical. Should missing values be removed?

Examples

Run this code
x = rnorm(n = 200, mean = 0, sd = 1)
sd(x)

Run the code above in your browser using DataLab