try this: dat <- data.frame(x = rnorm(10), y = rexp(10), z = letters[1:10]) colMeans(data.matrix(dat[sapply(dat, is.numeric)]))
I hope it helps. Best, Dimitris ---- Dimitris Rizopoulos Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm Quoting Diogo André Alagador <[EMAIL PROTECTED]>: > Hi all, > > I would like to know if it is posible by, someway, to get colMeans from > a data.frame with numeric as well as character data, dispersed all over > the object. Note that I would like to get colMeans neglecting character > data. > > I am really in need of some function proceeding in that way > > All the best > > Diogo André Alagador > > [[alternative HTML version deleted]] > > Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.