Displaying 1 result from an estimated 1 matches for "sprobabl".
Did you mean:
probabl
2010 Sep 11
5
for loop
Hello,
I have a simple question: I want to list numbers 1:k, but if k <1, I hope nothing listed.
how should we do?
k=2
for (i in 1:k) print(i)
[1] 1 # <-correct
[1] 2
k=0
for (i in 1:k) print(i)
[1] 1 #<---- wrong
[1] 0
thanks
jian
[[alternative HTML version deleted]]