This is a random data set being generated here for understanding and plotting a hierarchical cluster in R. I need to know the logic behind why the difference in the calls to rnorm for the x and y axis of the plot. Why y<-rnorm(12, mean=rep(c(1,2,1) when I would have expected mean=rep(c(1,2,3). Perhaps just the literal translation would help me.
set.seed(1234); par(mar=c(0,0,0,0)) ## par sets parameter mar (sets margin)
x<-rnorm(12, mean=rep(1:3,each=4),sd=0.2) ## repeat the vector 3 times
y<-rnorm(12, mean=rep(c(1,2,1),each=4),sd=0.2) ## ?????
plot(x,y,col="blue",pch=19,cex=2)
text(x+0.05,y+0.05,label=as.character(1:12))
Any help appreciated!