FES 720 Introduction to R

LAB: Sequences of Numbers

This is the lab associated with the lecture and lesson on Workspace and Files in R.

Please upload your final completed lab on the Assignments page in Canvas, as per the instructions below.

You are welcome and expected to ask for help from the instructors if you get stuck: Please also come to the R Bootcamp on Friday!


Questions

  1. Type out the integers from 1 to 10

  2. There are at least two other ways to generate this sequence. What are they?

  3. Write code to generate the sequence of integers 1, 3, 5, 7, 9, 11.

  4. Write code to generate the years that are leap years from 2000 to 2099 in the Gregorian calendar.

  5. Generate the sequence of dates in February of a leap year.

  6. Generate a sequence of the number of hours in a day.

  7. Generate the countdown to a rocket launch, followed by the text “Blast off!”

  8. Suppose you have a database that is 1000 rows. Generate a sequence that you could use to extract every 8th row.


Updated: 2017-09-12