[R] Need explaining to the ASH code in MASS
Saji Ren
saji.ren at gmail.com
Thu Dec 10 13:58:29 CET 2009
Hi,everyone:
In MASS chapter 5, the codes that yield a ASH for the "duration" data is read below:
> breaks <- seq(0, 5.9, 0.1)
> counts <- numeric(length(breaks))
> for(i in (0:4)) counts[i+(1:55)] <- counts[i+(1:55)] + rep(hist(duration, breaks=0.1*i + seq(0, 5.5, 0.5), prob=TRUE, plot=FALSE)$intensities, rep(5,11))
> plot(breaks+0.05, counts/5, type="l", xlab="duration", ylab="averaged", bty="n", xlim=c(0, 6), ylim=c(0, 0.7))
> detach()
can anyone explain the third line to me?
Thank you.
More information about the R-help
mailing list