title: Importing World Bank data for all countries in a region using the WDI package
body: <p>I am using the <code>R</code> package <code>WDI</code> which allows importing of World Bank data through their API. The problem is that I want to look at all countries in a region, e.g. Sub-Saharan Africa. However for this I need to specify so many countries (SSH is 49 right now).</p>
  
  <p>To start with this is inefficient, especially considering that the data explorer on data.worldbank.org does allow you to select a region.</p>
  
  <p>However the real problem is that the number of countries becomes problematic to handle for (I' m guessing) the World Bank API, because a too-large number of countries gives an HTTP error. Causing me to have to split the request in two parts.</p>
  
  <p>However, when using the more efficient <code>ALL</code> value there is no error, even though the number of observations is a lot higher.</p>
  
  <p>Right now my code looks like this:</p>
  
  <pre><code>library(WDI)
  
  COUNTRIES1 &lt;- c( "AGO","BEN","BWA","BFA","BDI","CMR","CPV","CAF","TCD","COM","ZAR","COG","CIV","GNQ","ERI","ETH","GAB","GMB","GHA","GNB","GIN","KEN","LSO","LBR","MDG" )
  COUNTRIES2 &lt;- c( "MWI","MLI","MRT","MUS","MYT","MOZ","NAM","NER","NGA","RWA","STP","SEN","SYC","SLE","SOM","ZAF","SSD","SDN","SWZ","TZA","TGO","UGA","ZMB","ZWE" )
  INDICATORS &lt;- c("NY.GDP.PCAP.KN", "SP.DYN.TFRT.IN", "SP.POP.TOTL")
  
  LONG1 &lt;- WDI( country=COUNTRIES1, indicator=INDICATORS, start=1960, end=2009, extra=FALSE)
  LONG2 &lt;- WDI( country=COUNTRIES2, indicator=INDICATORS, start=1960, end=2009, extra=FALSE)
  
  LONG &lt;- merge( LONG1, LONG2, by=intersect( names(LONG1),names(LONG2) ), all=TRUE )
  </code></pre>
  
  <p>I have tried using <code>SSH</code> as a country code, but this gives an aggregate of all SSH countries, rather than all the observations.</p>
  
  <p>Any idea's?</p>