0 votes
in R Language by
Multiple groups in R language

1 Answer

0 votes
by

A summary statistic can be realized among multiple groups.

# Multiple groups
data % > %
	group_by(yearID, teamID) % > %
	summarise(mean_games = mean(G)) % > %
	arrange(desc(teamID, yearID))

Code Explanation

  • group_by(yearID, teamID): Group by year and team
  • summarise(mean_games = mean(G)): Summarize the number of game player
  • arrange(desc(teamID, yearID)): Sort the data by team and year

Related questions

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