Exercise

Computing in j (III)

In the previous exercise, you were able to pass expressions in j that returned a vector. Recall that if you want to return a data.table instead, wrap the expression with list() (or it's alias, .()). This lets you:

  • Rename the column result
  • Compute more than one expression on a column
  • Compute on more than one column

Instructions 1/3

undefined XP
  • 1

    Calculate the average duration as a one-column data.table with the column name mean_durn.

  • 2

    Calculate the minimum and maximum duration (don't rename the columns).

  • 3

    Find the average duration and the date of the last ride (using the end_date column). Name these columns mean_duration and last_ride, respectively.