title: How to read an Excel file as a data frame
body: <p>I'm trying to make some barplots with data from the IMF. I tried to read the xls file with read.table():</p>
  
  <pre><code>base &lt;- read.table("http://www.imf.org/external/pubs/ft/weo/2017/02/weodata/WEOOct2017all.xls", header=TRUE, sep="\t", fill=TRUE)
  </code></pre>
  
  <p>However, the data is saved as a list:</p>
  
  <pre><code>typeof(base)
  [1] "list"
  </code></pre>
  
  <p>And I don't know how to extract the data to make a barplot. For example, I want to graph the variable "NGDP_RPCH", for the country "ARG" and the years 2010-2019 (columns 40-49 in the excel).</p>
  
  <p>I tried this, but it didn't work:</p>
  
  <pre><code>graph &lt;- base[which((base[2]=="ARG")&amp;(base[3]=='NGDP_RPCH')),40:49]
  graph
  [1] X2010 X2011 X2012 X2013 X2014 X2015 X2016 X2017 X2018 X2019
  &lt;0 rows&gt; (or 0-length row.names)
  </code></pre>
  
  <p>I would like to know how to save the data as a data frame, or how to extract a vector of data from the list, so I could run:</p>
  
  <pre><code>barplot(graph).
  </code></pre>