1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to R

Connected

Exercise

Vector selection: the good times (3)

Selecting multiple elements of poker_vector with c(2, 3, 4) is not very convenient. Statisticians created an easier way to do this: c(2, 3, 4) can be abbreviated to2:4, which generates a vector with all natural numbers from 2 up to 4.

So, another way to find the mid-week results is poker_vector[2:4]. Notice how the vector 2:4 is placed between the square brackets to select element 2 up to 4.

Instructions

100 XP

Assign to roulette_selection_vector the roulette results from Tuesday up to Friday; make use of : if it makes things easier for you.