sd {rvec} | R Documentation |
Standard Deviation, Including Rvecs
Description
Calculate standard deviation of x
, where x
can be
an rvec. If x
is an rvec, separate standard deviations
are calculated for each draw.
Usage
sd(x, na.rm = FALSE)
Arguments
x |
A numeric vector or R object, including an |
na.rm |
Whether to remove |
Details
To enable different behavior for rvecs and for ordinary vectors,
the base R function stats::sd()
is turned into a generic,
with stats::sd()
as the default.
For details on the calculations, see the documentation
for stats::sd()
.
Value
An rvec, if x
is an rvec. Otherwise
typically a numeric vector.
See Also
Examples
x <- rvec(cbind(rnorm(10), rnorm(10, sd = 20)))
x
sd(x)
[Package rvec version 0.0.6 Index]