win-vector.com
R Tip: Use seq_len() to Avoid The Backwards Sequence Trap
Another R tip. Use seq_len() to avoid the backwards sequence trap. Many R users use the “colon sequence” notation to build sequences. For example: for(i in 1:5) { print(paste(i, i*i)) }…