[R] Loading Chess Data
Rui Barradas
ruipbarradas at sapo.pt
Sun Sep 2 20:50:53 CEST 2012
Hello,
Try the following
library(XML)
url <- "http://ratings.fide.com/top.phtml?list=men"
chess <- readHTMLTable(url, header = TRUE, which = 5)
str(chess) # See what we have
# All variables are factors,
# convert these to integer
chess$Rating <- as.integer(chess$Rating)
chess$Games <- as.integer(chess$Games)
chess$`B-Year` <- as.integer(chess$`B-Year`)
head(chess, 20) # See first 20 rows
Hope this helps,
Rui Barradas
Em 02-09-2012 17:41, David Arnold escreveu:
> All,
>
> What would be the most efficient way to load the data at the following
> address into a dataframe?
>
> http://ratings.fide.com/top.phtml?list=men
>
> Thanks,
>
> David
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Loading-Chess-Data-tp4642006.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list