rms {iemisc} | R Documentation |
Root-mean-square
Description
This function computes the sample root-mean-square (RMS).
Usage
rms(x, na.rm = FALSE)
Arguments
x |
numeric vector that contains the sample data points. |
na.rm |
logical vector that determines whether the missing values should be removed or not. |
Details
RMS is expressed as
x_{rms} = \sqrt{\frac{\sum \limits_{i=1}^n{x_{i}^{2}}}{n}}
x_rms
the sample harmonic mean
- x
the values in a sample
- n
the number of values
Value
sample root-mean-square as a numeric vector. The default choice is that
any NA values will be kept (na.rm = FALSE
). This can be changed by
specifying na.rm = TRUE
, such as rms(x, na.rm = TRUE)
.
Author(s)
Irucka Embry
References
Masoud Olia, Ph.D., P.E. and Contributing Authors, Barron's FE (Fundamentals of Engineering Exam), 3rd Edition, Hauppauge, New York: Barron's Educational Series, Inc., 2015, page 84.
See Also
sgm
for geometric mean, shm
for harmonic mean, cv
for coefficient of variation (CV), relerror
for relative error,
approxerror
for approximate error, and ranges
for sample range.
Examples
library(iemisc)
samp <- c(0.5, 100, 1000.25, 345, 0.0213, 0, 45, 99, 23, 11, 1, 89, 0, 34,
65, 98, 3)
rms(samp)