CommencerCommencer gratuitement

Filtering with %in%

%in% allows selecting rows that exactly matches one or more values, for example:

c("a", "b", "c", "d") %in% c("d", "a")
[1]  TRUE FALSE FALSE  TRUE

Cet exercice fait partie du cours

Data Manipulation with data.table in R

Afficher le cours

Instructions

Filter all rows where trip_id is equal to 588841, 139560, or 139562.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Filter all rows where trip_id is 588841, 139560, or 139562
filter_trip_ids <- batrips[___]
filter_trip_ids
Modifier et exécuter le code