Comment

Comment by educationdata

The second example should be written like this:

  diamondsDT[cut != "Fair", .(AvgPrice = mean(price),
                              MedianPrice = as.numeric(median(price)),
                              Count = .N), cut][order(-Count)]
There is no need to break it to 10 lines.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton