I am trying to grab some statistics from the fifa.com by using XML package. The import is successful but the column names have unicode symbols. I want to remove those symbols.
This is how I have got the data,
library(XML)
url <- "http://www.fifa.com/worldcup/statistics/teams/disciplinary.html"
foulbycountry <- readHTMLTable(url)
foulbycountry1 <- do.call(rbind.data.frame, foulbycountry)
The variable names include two characters that I want to remove. I have tried to create a new object but it is not working. For example,
country <- foulbycountry1$Teams??
fouls.committed <- foulbycountry1$Fouls Committed??
which gives me the following output,
> country <- foulbycountry1$Teams??
Error: unexpected input in "country <- foulbycountry1$Teams?"
> fouls.committed <- foulbycountry1$Fouls Committed??
Error: unexpected symbol in "fouls.committed <- foulbycountry1$Fouls Committed"
Is there any way you can suggest so that I can remove those extra unicode characters?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…