Aan de slagGa gratis aan de slag

Combining i and j

As you saw in an earlier exercise when you combine i and j, data.table first filters the rows in i and then applies the computation in j. This applies when calculating multiple stats as well.

Additionally, you can also specify plot(), hist() or any other plotting functions in the j argument.

Deze oefening maakt deel uit van de cursus

Data Manipulation with data.table in R

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

duration_stats <- batrips[___, 
                          .(___, 
                            ___)]
duration_stats
Code bewerken en uitvoeren