1.3 Excel spreadsheets

The readxl package can import data from Excel workbooks. Both xls and xlsx formats are supported.

Since workbooks can have more than one worksheet, you can specify the one you want with the sheet option. The default is sheet=1.

library(readxl)

# import data from an Excel workbook
Salaries <- read_excel("data/salaries.xlsx", sheet=1)