[R] A coding question

From: xpRt.wannabe <xprt.wannabe_at_gmail.com>
Date: Fri 02 Jun 2006 - 09:22:25 EST


Dear List:

I have the follow code:

y <- replicate(10,replicate(8,sum(rnorm(rpois(1,5)))))

Now I need to apply the following condition to _every_ randomly generated Normal number in the code above:

x - max(0,x-15) + max(0,x-90), where x represents the individual Normal numbers.

In other words, the said condition needs to be applied before replicate(...(replicate(...(sum(...))) takes place.

Any help would be greatly appreciated.

platform i386-pc-mingw32
arch i386
os mingw32
system i386, mingw32
status
major 2
minor 2.1
year 2005
month 12

day 20
svn rev 36812
language R



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Jun 02 15:12:18 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 02 Jun 2006 - 20:10:30 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.