Thank you guys for your suggestions!  Florent D - that probably is the way of
writing what I had in my head.  The suggestion I took up was one of
JHoltman's which he put in an e-mail to me following his initial post but it
works well with the vectors in this question:

require(plyr)
x1.6 <- laply(1:6, function(a) get(paste('x', a, sep = '')))
rowMeans(x1.6)

It is nice because it's easily extendable to matrices too which I want to do
later - change rowMeans(x1.6) to colMeans(x1.6).

Thank you all for your help,

Pablo

--
View this message in context: 
http://r.789695.n4.nabble.com/Summing-x1-to-x6-tp4214604p4216977.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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.

Reply via email to