djbanana <karl79264...@gmail.com> writes: > Hi, > > I think I solved it myself by writing loops. > > What I meant is: are there in-built functions in R that calculate the > following: > > a1(b2+...+b190) + a2(b1+b3+...+b190) + ...
Following Rainer's setup: x <- data.frame( a = sample( 1:10, 4 ), b = sample( 11:20, 4 ) ) isn't prod( colSums(x) ) - x$a %*% x$b what you are after? HTH, Chuck > > I managed to solve it, quite similar to what you just emailed. > > Thanks anyway! > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/summation-coding-tp4646678p4646712.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.