Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8098087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:58:15+00:00 2026-06-05T21:58:15+00:00

I have a simple question. I’m trying to get a list of the indicators

  • 0

I have a simple question. I’m trying to get a list of the indicators available on the Open data api. I use the RCurl function getURL to pull the contents of http://api.worldbank.org/indicators, and then the XML function xmlTreeParse on the resulting xml page. But xmlTreeParse just treats the xml file as a big block of test. Why is this? Thanks!

library(RCurl)
library(XML)

temp <- getURL("http://api.worldbank.org/indicators)
temp <- xmlTreeParse(temp)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T21:58:17+00:00Added an answer on June 5, 2026 at 9:58 pm

    You can use

    temp <- getURL("http://api.worldbank.org/indicators")
    temp <- xmlParse(temp)
    xpathSApply(temp,"//wb:source") # example access data 1
    xpathSApply(temp,"//wb:source[@id=2]") # example access data 2
    

    use xmlParse or xmlTreeParse(useInternalNodes=T)

    with this simple structure you can transform to a dataframe as follows

    my.df<-xmlToDataFrame(temp)
    

    or a list

    my.list<-xmlToList(temp)
    
    > my.list[[1]]
    $name
    [1] "Agricultural machinery, tractors"
    
    $source
    $source$text
    [1] "World Development Indicators"
    
    $source$.attrs
     id 
    "2" 
    
    
    $sourceNote
    [1] "Agricultural machinery refers to the number of wheel and crawler tractors (excluding garden tractors) in use in agriculture at the end of the calendar year specified or during the first quarter of the following year."
    
    $sourceOrganization
    [1] "Food and Agriculture Organization, electronic files and web site."
    
    $topics
    $topics$topic
    $topics$topic$text
    [1] "Agriculture & Rural Development  "
    
    $topics$topic$.attrs
     id 
    "1" 
    
    
    
    $.attrs
                  id 
    "AG.AGR.TRAC.NO" 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple question that boggles me. I am trying to use the
I have a simple question. Let me explain We use this to pass data
i have a simple question, there is a function with parameter emp_id that opens
I have another simple question about Node. I'm trying to make a simple http
I have simple question. Is there any way to use routing in cotroler to
A simple question I suspect. I have the simple function definition makePatientFixture :: [
I have a simple question about Backbone.js' get and set functions. 1) With the
I have one simple question about throwing exeptions in re.match function Is there a
I have a simple question, I use Vim with two viewport: e: (filesystem) File
I have a simple question. lets say we have two arrays: data = [1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.