Computes standard deviation of a vector with numeric or logical values.
my_sd(x, na.rm = TRUE, inf.rm = TRUE)
x | A numeric or logical vector. |
---|---|
na.rm | Boolean specifying whether or not to remove NA and NaN values.. |
inf.rm | Boolean specifying whether or not to remove Inf values. |
The standard deviation of the values in x returned as a numeric vector of length one.
The denominator n - 1 is used which gives an unbiased estimator of the (co)variance for i.i.d. observations.
x <- 1:10 my_sd(x)#> [1] 3.02765