Skip to main content
2 of 4
deleted 20 characters in body; edited title
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

Extracting non-spatial data from imported KML file using R?

I have a KML file which was created using Google's My Maps.

The original file can be downloaded here: Google My Maps

Using R, I can import this using the "readOGR" function of the rgdal library This brings the KML file in as a SpatialPointsDataFrame (SPDF) - which i am calling asf52

![RStudio Data Pane

In this SPDF, the spatial data is contained under @coords and is readily extracted into a dataframe using code like

df  <- data.frame(asf52@coords[,1:2])

However, I am struggling to come up with a way to neatly extract the the non-spatial data - contained under @Description - and turn it into a dataframe with a column for each variable.