Message-ID: <Pine.LNX.4.10.10109261031250.2586-100000@localhost.localdomain>
Date: 2001-09-26T09:32:11Z
From: Bill Simpson
Subject: vectorization help please
In-Reply-To: <3BB19DF0.CD6328A0@statistik.uni-dortmund.de>
> > What is a smarter way of doing:
> >
> > for(i in 1:xn)
> > for(j in 1:yn)
> > {
> > im2[i,j]<- im[i,j]* (-1)^(i+j)
> > }
>
>
> im * (-1)^(row(im) + col(im))
>
> Uwe
>
Thanks very much Uwe.
Bill
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._