Skip to content
Prev 172201 / 398506 Next

Need help extracting info from XML file using XML package

Hi,

You also might want to check R4X:

# install.packages("R4X", repos="http://R-Forge.R-project.org")
require( "R4X" )
x <- xml("http://code.google.com/apis/kml/documentation/KML_Samples.kml")
coords <- x["////Polygon///coordinates/#" ]
data <- sapply( strsplit( coords, "(,|\\s+)" ), as.numeric )

Romain