1. Learn
  2. /
  3. Courses
  4. /
  5. Data Manipulation with data.table in R

Connected

Exercise

Filtering rows using logical vectors

In this exercise, you'll use expressions that evaluate to a logical vector to filter rows in a data.table. All rows that evaluate to TRUE will be returned.

Note that you can refer to column names directly, without the need for the $ operator.

Instructions 1/4

undefined XP
  • 1

    Filter all the rows where start_station is "MLK Library".

  • 2

    Filter all rows where start_station is "MLK Library" and duration is greater than 1600.

  • 3

    Filter all rows where the column subscription_type is not "Subscriber".

  • 4

    Filter all rows where start_station is "Ryland Park" and subscription_type is not "Customer".