[R] Adding numbers in Outputs

Jinyan Huang jinyan.fr at gmail.com
Fri Dec 10 14:57:17 CET 2010


X<-list(40,c(80,160),c(160,80,400))
Y<-list(10,c(10,30),c(5,18,20))
Z<-c(1,2,3)
as.data.frame(do.call("rbind",X))->x
as.data.frame(do.call("rbind",Y))->y
x*y*Z->r
r[upper.tri(r)] <- 0
rowSums(r)



More information about the R-help mailing list