R/SD.R

"SD" <- 
function (x, na.rm = TRUE) 
{
    if (is.matrix(x)) 
        apply(x, 2, SD, na.rm = na.rm)
    else if (is.vector(x)) 
        sqrt(var(x, na.rm = na.rm,use="pair"))
    else if (is.data.frame(x)) 
        apply(x,2, SD, na.rm = na.rm)
    else sqrt(var(as.vector(x), na.rm = na.rm,use="pair"))
}

Try the psych package in your browser

Any scripts or data that you put into this service are public.

psych documentation built on Sept. 26, 2023, 1:06 a.m.