Rmatrix |
> x=(1:20)
> y=20:1
> z=c(1:20,19:1)
> tmp <-c(4,6,3)
> rep(tmp,10)
[1] 4 6 3 4 6 3 4 6 3 4 6 3 4 6 3 4 6 3 4 6 3 4 6 3 4 6 3 4 6
[30] 3
> rep(tmp,l=31)
[1] 4 6 3 4 6 3 4 6 3 4 6 3 4 6 3 4 6 3 4 6 3 4 6 3 4 6 3 4 6
[30] 3 4
> rep(tmp,l=34)
[1] 4 6 3 4 6 3 4 6 3 4 6 3 4 6 3 4 6 3 4 6 3 4 6 3 4 6 3 4 6
[30] 3 4 6 3 4
> rep(tmp,times=c(5,20,30))
[1] 4 4 4 4 4 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 3 3 3 3
[30] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
> tmp <- seq(3,6,by=0.1)
> exp(tmp)*cos(tmp)
[1] -19.884531 -22.178753 -24.490697 -26.773182 -28.969238
[6] -31.011186 -32.819775 -34.303360 -35.357194 -35.862834
[11] -35.687732 -34.685042 -32.693695 -29.538816 -25.032529
[16] -18.975233 -11.157417 -1.362099 10.632038 25.046705
[21] 42.099201 61.996630 84.929067 111.061586 140.525075
[26] 173.405776 209.733494 249.468441 292.486707 338.564378
[31] 387.360340
>
> plot(tmp)
> plot(exp(tmp)*cos(tmp))
> plot(tmp,exp(tmp)*cos(tmp))
> plot(exp(tmp)*cos(tmp),tmp)
> plot(tmp/3,exp(tmp)*cos(tmp))
> plot(tmp*5,exp(tmp)*cos(tmp),colour=7)
y <- rnorm(100)
> hist(y, probability=TRUE)
> lines(density(y))
> lines(density(y),col=99)
0 Comments