I am trying to figure out how to combine items that are similarly named in the same column.
For instance the data I have looks like this:
Home_Team Goals_from_Home Away_Team Goals_Away_From_Home
Man United 2 Leicester 1
Arsenal 2 Newcastle 0
Man United 1 Newcastle 0
How would I go about combing everything that has the same name and team into one? I am using this dataset:
https://data.world/chas/2018-2019-premier-league-matches/workspace/file?filename=2018-2019.csv
And so far what I have done is to make everything into a data frame and now I am stuck from there.
My code as it looks:
soccer_data <- read.csv("2018-2019.csv")
home_team <- c(soccer_data$HomeTeam)
goals_at_home <- c(soccer_data$FTHG)
goals_away_from_home <- c(soccer_data$FTAG)
away_team <- c(soccer_data$AwayTeam)
soccer_data_frame <- data.frame(home_team, goals_at_home, away_team, goals_away_from_home)
question from:
https://stackoverflow.com/questions/65877619/how-to-combine-columns-that-have-same-name 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…