http://then.gasbuddy.com/をスクレイピングしようとしています。
Rで次のコードを実行しています
library(RCurl)
library(XML)
doc <- htmlTreeParse('http://www.southcarolinagasprices.com/GasPriceSearch.aspx?typ=adv&fuel=A&srch=0&area=All%20Areas&station=All%20Stations&tme_limit=4')
rootNode <- xmlRoot(doc)
((rootNode[[2]][4])[1][[1]])[[15]][[1]][[11]][[1]][[1]][[2]][[8]][[1]][[2]][[1]][[1]][[1]][[1]][[1]][[1]]
#<div class="p1"/>
x <- matrix(, nrow = 20, ncol = 4)
x[1,1] <- xmlValue(((rootNode[[2]][4])[1][[1]])[[15]][[1]][[11]][[1]][[1]][[2]][[8]][[1]][[2]][[1]][[1]][[1]][[1]][[1]][[1]])
しかし、私はこのエラーがあります
置換の長さはゼロです
p1 を減算して行列に入れるにはどうすればよいですか?