Working with Excel files
Excel is another popular tool used to store and analyze data. Of course, one can convert Excel files to CSV files or other text formats by using Excel. Alternatively, to simplify the process, you can use install
and load the xlsx
package to read and process Excel data in R.
Getting ready
In this recipe, you need to prepare your environment with R installed and a computer that can access the Internet.
How to do it…
Please perform the following steps to read Excel documents:
- First, install and load the
xlsx
package:> install.packages("xlsx") > library(xlsx)
- Access www.data.worldbank.org/topic/economy-and-growth to find world economy indicator data in Excel:
- Download world economy indicator data from the following URL using
download.file
:> download.file("http://api.worldbank.org/v2/en/topic/3?downloadformat=excel", "worldbank.xls", mode="wb")
- Examine the downloaded file with Excel (or...