On Sep 11, 2010, at 8:39 AM, Peng, C wrote:
>
> or:
>
> k=0
> for (i in 1:k) if(k>0) print(i)
Because of the way the ":" operator works, I would have tested k >=1
> k=0.5
> for (i in 1:k) if (k>0){print(i)}
[1] 1
But Gabor's suggestion to use seq_len(k) is cleaner, anyway.
--
David Winsemius, MD
West Hartford, CT