Skip to content
Prev 319475 / 398506 Next

HOw to achieve big vector times big dataframe in R?

apply((t(as.matrix(b)) * a), 2, sum)

should do what you want.

Why this works; see,  
http://cran.r-project.org/doc/manuals/r-release/R-intro.html#The-recycling-rule and the paragraph before  
that.

Jan



Tammy Ma <metal_licaling at live.com> schreef: