R: For Loops
Code Only
|
Code with Rweb Output
|
_hat=c() ### Create an empty hat to store numbers in
for(i in 1:10){ hat[i]=i+5 } hat |
_> hat=c() ### Create an empty hat to store numbers in
> > for(i in 1:10){ + + hat[i]=i+5 + + } > > hat [1] 6 7 8 9 10 11 12 13 14 15 |
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.