Session Ready
Exercise

Constructing IRanges

In the video, some IRanges constructor examples were provided. This is your turn to practice creating sequence ranges with different arguments and see how these arguments are reused or complemented.

Using the IRanges() function, you can specify parameters such as start, end, or width. These parameter inputs can fall into one of two categories:

  • start, end, and width are numeric vectors.
  • The start parameter is a logical vector.

Missing arguments will be resolved using the equation width = end - start + 1.

The IRanges() constructor indicates that all of the parameters are optional with default NULL:

IRanges(start = NULL, end = NULL, width = NULL, names = NULL)
Instructions
100 XP

Construct an IRanges object with the following arguments:

  • A start equal to a vector of values 1 through 5 and end equal to 100.
  • An end equal to 100 and width equal to both 89 and 10.
  • start equal to Rle(c(F, T, T, T, F, T, T, T)).
  • Print the objects and see the results!