Skip to content
Prev 360787 / 398506 Next

Assistance with httr package with R version 3.3.0

Hi Jim,

Thank you for your suggestion. I have actually tried to upload XML and xml2
but nothing changed...any other suggestion?

Kind regards,

Luca
https://docs.google.com/spreadsheets/d/102-jJ7x1YfIe4Kkvb9olQ4chQ_TS90jxoU0vAbFZewc/pubhtml?gid=0&single=true
"
+   r <- GET(url)
+   html <- content(r)
+   sheets <- readHTMLTable(html, header=FALSE, stringsAsFactors=FALSE)
+   df <- sheets[[sheet]]
+   dfClean <- function(df){
+     nms <- t(df[1,])
+     names(df) <- nms
+     df <- df[-1,-1]
+     row.names(df) <- seq(1,nrow(df))
+     df
+   }
+   dfClean(df)
+ }
Error in (function (classes, fdef, mtable)  :
  unable to find an inherited method for function ?readHTMLTable? for
signature ?"xml_document"?
2016-05-10 8:52 GMT+02:00 Jim Lemon <drjimlemon at gmail.com>: