-5

The Financial Times publishes Excel files on their website: http://www.ft.com/cms/s/0/988051be-fdee-11e3-bd0e-00144feab7de.html#axzz3MBmtHOiy.

I don't know anything about R, except that it can load files and then you can look at them. How does one open a file that's on the internet and not on my local hard disk so that I can load them directly into R without downloading them?

The exact file I want is the FT Global 500: http://im.ft-static.com/content/images/7097ad1a-fded-11e3-bd0e-00144feab7de.xls

Matthew Turner
  • 3,564
  • 2
  • 20
  • 21
Art
  • 69
  • 4

1 Answers1

3

It's very easy.

See Importing Excel file using url using read.xls, which I used as a reference.

First, you need the gdata package, which you install by doing

install.packages(gdata)

Then, load that package and download the file like so:

require(gdata)
data_frame <- read.xls("http://im.ft-static.com/content/images/7097ad1a-fded-11e3-bd0e-00144feab7de.xls")
head(data_frame)

The first few columns will be

                     FT.Global.500.2014                X         X.1     X.2                                  X.3             X.4         X.5
1 Market values and prices at 31 March 2014                                                                                                 
2                          Global rank 2014 Global rank 2013     Company Country                          Sector Market value $m Turnover $m
3                                         1                1       Apple      US Technology hardware & equipment       478,766.1   170,910.0
4                                         2                2 Exxon Mobil      US             Oil & gas producers       422,098.3   390,247.0
5                                         3                7   Microsoft      US    Software & computer services       340,216.8    77,849.0
6                                         4               15      Google      US    Software & computer services       313,003.9    59,825.0
Community
  • 1
  • 1
Matthew Turner
  • 3,564
  • 2
  • 20
  • 21