Exploratory Community

How to import XML data


We currently don’t support XML data out of the box, but you can write a R script to read the XML data.

Here’s an example R script:


url <- "https://feeds.capitalbikeshare.com/stations/stations.xml"
df_station <- url %>% 
  RCurl::getURL() %>% 
  XML::xmlParse() %>% 
  XML::xmlToDataFrame(., stringsAsFactors = FALSE)
  1. Select ‘R Script’ from the data frame menu.

  2. Past the above script.

And it looks like this.

Note that you will also need to install ‘RCurl’ package in order to run the above script. Here’s how to install R package.


1 Like