Import data

# excel file
data <- read_excel("../00_data/MyData_charts.xlsx")
data

State one question

Which country has scored the most goals from 1930-2018

Filter

filter(data, home_score >= 20)

Plot data

ggplot(data, aes(x = home_team, y = home_score)) + 
  geom_bar(stat = "identity") 

Interpret

It seems to be an outlier in the bar chart, the last bar is not suppose to be that high. The other bars seems to be correct, Brazil = 177 goals, which is the most goals in total a home team a have scored.

Side note

In the future I wish to learn how to make my bar chart more clear, so that you can see and separate the teams from each other. I tried to use a filiter in order to make the data set a little smaller, but I didn’t manage to get it to work.