使用R中的xmlSApply提取xml数据

时间:2016-01-07 19:56:41

标签: xml r

我尝试从下面的URL中的xml文件中提取zipcodes(参见代码)。

fileurl <- "http://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Frestaurants.xml"
doc <- xmlTreeParse(fileurl)
root <- xmlRoot(doc)
xmlName(root)
xmlSApply(root, function(x) xmlSApply(x, xmlValue))

但是,我似乎无法获取邮政编码并将其放入数据框中。

0 个答案:

没有答案