R Tip: Use seq_len() to Avoid The Backwards Sequence Bug

Win-Vector Blog 2018-02-19

Summary:

Another R tip. Use seq_len() to avoid The backwards seqeunce bug. Many R users use the “colon sequence” notation to build sequences. For example: for(i in 1:5) { print(paste(i, i*i)) } #> [1] "1 1" #> [1] "2 4" #> [1] "3 9" #> [1] "4 16" However, the colon notation can be unsafe as … Continue reading R Tip: Use seq_len() to Avoid The Backwards Sequence Bug

Link:

http://www.win-vector.com/blog/2018/02/r-tip-use-seq_len-to-avoid-the-backwards-sequence-bug/

From feeds:

Statistics and Visualization » Win-Vector Blog

Tags:

Authors:

John Mount

Date tagged:

02/19/2018, 15:05

Date published:

02/19/2018, 09:49