html - readHTMLTable in R -


i trying read html table in r, , perform further analysis on it. found readhtmltable() in r. when download table interested in, , try perform analysis on it, given reply vector null, , having troubles converting numeric can perform averages, , further calculations on. if has ideas help, great! attach code below. many thanks

alex

a=readhtmltable("http://www.nhl.com/ice/standings.htm?season=20132014&type=lea",which=3,trim=f,colclasses) summary(a) a=droplevels(a) summary(a) 

following works me:

require(xml) appurl <- "http://www.nhl.com/ice/standings.htm?season=20132014&type=lea" xdata <- htmlparse(appurl) appstats <- readhtmltable(xdata['//table'][[3]]) > head(appstats)     structure(c("p - boston", "z - anaheim", "y - colorado", "x - st. louis",  div  gp   w   l   ot   p   row   gf   ga   diff    home    away   s/o  1 1                                                                 p - boston     82  54  19    9 117    51  261  177    +84  31-7-3 23-12-6   3-6 2 2                                                                z - anaheim   p   82  54  20    8 116    51  266  209    +57  29-8-4 25-12-4   3-6 3 3                                                               y - colorado   c   82  52  22    8 112    47  250  220    +30 26-11-4 26-11-4   5-4 4 4                                                              x - st. louis   c   82  52  23    7 111    43  248  191    +57  28-9-4 24-14-3   9-3 5 5                                                               x - san jose   p   82  51  22    9 111    41  249  200    +49  29-7-5 22-15-4  10-7 6 6                                                             y - pittsburgh   m   82  51  24    7 109    44  249  207    +42  28-9-4 23-15-3   7-3    l10   streak  1 5-2-3   lost 1 2 7-2-1    won 4 3 7-1-2     ot 1 4 3-7-0   lost 6 5 5-4-1    won 2 6 5-3-2     ot 2 

Comments

Popular posts from this blog

jQuery Mobile app not scrolling in Firefox -

c++ - How to add Crypto++ library to Qt project -

php array slice every 2th rule -