Use the n() function from dply for counts