Look at the result of typing the following code into R:

n <- 1000
x <- seq(1, n)
sum(x)

Based on the result, what do you think the functions seq and sum do? You can use help.

  1. sum creates a vector of numbers and seq adds them up.
  2. seq creates a vector of numbers and sum adds them up.
  3. seq creates a random vector and sum computes the sum of 1 through 1,000.
  4. sum always returns the same number.

Type the number (1, 2, 3, 4) in the script below to submit your answer.