RMS | R Documentation |
Calculates the root mean square of a sequence, which is defined as the square-root of the squared arithmetic mean.
RMS(x, trim = 0, na.rm = TRUE) colRMS(x, na.rm = TRUE, ...) rowRMS(x, na.rm = TRUE, ...)
x |
[from |
trim |
numeric; [from |
na.rm |
[from |
... |
additional parameters given to either
|
The functions
rowRMS
and colRMS
cannot accept trim
arguments because they use rowMeans
and colMeans
, respectively.
[1] http://en.wikipedia.org/wiki/Root_mean_square
Other utilities:
list.txtgz()
,
norms()
,
pbo_message()
x <- sin(seq(-pi,pi,by=0.05)) xr <- RMS(x) # this: RMS(c(4,9)) # should equal ~6.96 # # The expected value for a default \code{sin} curve is sqrt(2)/2 plot(x, type="l") lines(abs(x), col="red") abline(h=c(mean(x), mean(abs(x)), sqrt(2)/2, xr), lty=4:1, col=4:1) # M <- matrix(1:12,3) colRMS(M) rowRMS(M)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.