swh:1:snp:81eadaa089e8253d8469bcef66aa332632c6c669
Tip revision: 162b33221cccd2760e0dd44598539c521ffcd73b authored by HwB on 18 March 2011, 00:00:00 UTC
version 0.2-2
version 0.2-2
Tip revision: 162b332
std.R
##
## s t d . R
##
# std(a, flag=0, dim=2) # dim = 1: along cols; = 2: along rows
std <- function(x, flag=0) {
n <- if (flag == 0) length(x) - 1 else length(x)
sqrt(sum((x-mean(x))*(x-mean(x)))/n)
}