I try to remove rows in HTML table with almost one empty element, represents by (NULL) using readHTMLTable() function in XLM package without success. In my code:
require(httr) require(XML) Function for read HTML table
readFE<- function (x, URL = ""){ FILE <- GET(url=URL) tables <- getNodeSet(htmlParse(FILE), "//table") FE_tab <- readHTMLTable(tables[[1]], header = c("empresa","desc_projeto","desc_regiao", "cadastrador_por","cod_talhao","descricao", "formiga_area","qtd_destruido","latitude", "longitude","data_cadastro"), colClasses = c("character","character","character", "character","character","character", "character","character","character", "character","character"), trim = TRUE, stringsAsFactors = FALSE ) x<-NULL results <- x x<-FE_tab[-(1),] results <- x results } --
Exemple
tableFE<-readFE(URL="https://www.dropbox.com/s/mb316ghr4irxipr/TALHOES_AGENTES.htm?dl=1") tableFE Someone could help me?
Thanks,
Alexandre
No comments:
Post a Comment