don't you want to pass f also to `d3.mean`?