Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

R - sequences and ranges

  • seq
nums = seq(1, 10, 2)
print(nums)  # 1 3 5 7 9
print(class(nums))  # "numeric"
print(is.numeric(nums))  # TRUE

other = seq(to = 19, from = 7, by = 3)
print(other)  #  7 10 13 16 19