[R] problem with FUN in Hmisc::summarize

hadley wickham h.wickham at gmail.com
Fri Apr 16 16:54:07 CEST 2010


> corr.V2.V3 = function(x) {
>  out = cor(x$V2, x$V3)
>  names(out) = "CORR"
>  return(out)
> }

A litte more concisely:

corr.V2.V3 = function(x) {
 c(CORR = cor(x$V2, x$V3))
}


-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/



More information about the R-help mailing list