vendredi 23 novembre 2018

Reading website table comes with a list name "NULL" in R

I want to read a table directly from a webpage with R. In reader's view the webpage with the table looks like this:

enter image description here

I used two packages to read the table from the webpage. It worked OK except the fact that the table is read as a list.

library(RCurl)
library(XML)
d<-getURL('https://wesiteAddress/data/')
d<-readHTMLTable(d, header=T)

Here is what I get after reading the table

> d
$`NULL`
    ID      X       Y Depth    P
1 1046 256857 2632323    13  2.8
2 1054 257090 2632039    13  1.1
3 1057 257099 2631981    13  2.6
4 1058 257071 2632004     9  2.1
5 1060 257173 2632004    13    4
6 1089 257194 2631660    13 14.1

Where is this $NULL coming from? is there a way to avoid it?




Aucun commentaire:

Enregistrer un commentaire