Learn R Programming

iemisc (version 0.5.0)

rms: 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.

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).

encoding

UTF-8

Details

RMS is expressed as

$$x_{rms} = \sqrt{\frac{\sum \limits_{i=1}^n{x_{i}^{2}}}{n}}$$

[object Object],[object Object],[object Object]

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

Run this code
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)

Run the code above in your browser using DataLab