in R Language by
Q:
Count function  in R language

▼ Show 1 Answer

0 votes
by

Count observations by group is always a good idea. With R, you can aggregate the the number of occurence with n().

For instance, the code below computes the number of years played by each player.

# count observations
data % > %
	group_by(playerID) % > %
	summarise(number_year = n()) % > %
	arrange(desc(number_year))
Learn More with Madanswer

Related questions

0 votes
asked Nov 6, 2019 in R Language by MBarbieri
...