Cannot reproduce the first example from XML library in R -
when run:
example(readhtmltable)
i following error:
error: failed load http resource
library xml installed , running. session info:
> sessioninfo() r version 3.1.1 (2014-07-10) platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] lc_collate=english_united states.1252 lc_ctype=english_united states.1252 [3] lc_monetary=english_united states.1252 lc_numeric=c [5] lc_time=english_united states.1252 attached base packages: [1] stats graphics grdevices utils datasets methods base other attached packages: [1] reshape2_1.4 ggplot2_1.0.0 xml_3.98-1.1 dplyr_0.2 loaded via namespace (and not attached): [1] assertthat_0.1 colorspace_1.2-4 digest_0.6.4 grid_3.1.1 gtable_0.1.2 [6] magrittr_1.0.1 mass_7.3-33 munsell_0.4.2 parallel_3.1.1 plyr_1.8.1 [11] proto_0.3-10 rcpp_0.11.2 scales_0.2.4 stringr_0.6.2 tools_3.1.1
do need install additional libraries?
when error happens, load httr
package , call it. here example own work first xml call returned error httr call did not:
require(httr) doc <- htmltreeparse('http://www.lewisthomason.com/locations/', useinternal = true) doc <- content(get('http://www.lewisthomason.com/locations/'))
Comments
Post a Comment