Categories

Nov 14, 2019 in R Language

Q: Filter in R Language

1 Answer

Nov 14, 2019

Before you intend to do an operation, you can filter the dataset. The dataset starts in 1871, and the analysis does not need the years prior to 1980.

# Filter
data % > %
	filter(yearID > 1980) % > %
	group_by(yearID) % > %
	summarise(mean_game_year = mean(G))

Code Explanation

  • filter(yearID > 1980): Filter the data to show only the relevant years (i.e. after 1980)
  • group_by(yearID): Group by year
  • summarise(mean_game_year = mean(G)): Summarize the data
Click here to read more about Loan/Mortgage
Click here to read more about Insurance

Related questions

Madanswer
Nov 14, 2019 in R Language
Nov 14, 2019 in R Language
Nov 14, 2019 in R Language
...