Message-ID: <Pine.GSO.4.10.10211252026090.1901-100000@athenas.ime.unicamp.br>
Date: 2002-11-25T22:34:22Z
From: Cezar Augusto de Freitas Anselmo
Subject: more on vectoring a simple for
In-Reply-To: <Pine.LNX.4.31.0211252209310.8036-100000@gannet.stats>
Excuse me, but I wasn't clear. It's a generic funcion, like
f(beta) and g(beta)
result<-rep(0,3)
for(i in 1:3) result[i]<-sum(f(beta[-i])/g(beta[-i]))
for example, f(beta)=log(abs(beta)) and g(beta)=beta^2:
for(i in 1:3) result[i]<-sum(log(abs(beta[-i]))/(beta[-i]^2))
How can I write this with no for?
Thanks and excuses by the lost time.
========================================
Cezar Freitas (ICQ 109128967)
IMECC - UNICAMP
Campinas, SP - Brasil
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._