LoslegenKostenlos loslegen

Computing stats by groups (I)

So far you have worked with the two dimensions, rows and columns of a data.table. It's now time to consider the virtual third dimension by dividing rows into groups to calculate statistics.

Diese Übung ist Teil des Kurses

Data Manipulation with data.table in R

Kurs anzeigen

Anleitung zur Übung

Compute the mean duration for every start_station, calling the aggregated column mean_duration.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Compute the mean duration for every start_station
mean_start_stn <- batrips[, .(___), by = ___]
mean_start_stn
Code bearbeiten und ausführen