swh:1:snp:81eadaa089e8253d8469bcef66aa332632c6c669
Tip revision: 63f12837f2d7d6d30cdc2b2df60efdef228d8d0f authored by HwB on 10 May 2011, 00:00:00 UTC
version 0.4-0
version 0.4-0
Tip revision: 63f1283
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)
}