Complete the code to load the readxl package.
library([1])The readxl package is used to read Excel files in R. You load it with library(readxl).
Complete the code to read an Excel file named 'data.xlsx'.
df <- read_excel([1])The file name must be a string, so it needs quotes: 'data.xlsx'.
Fix the error in the code to read the second sheet of an Excel file.
df <- read_excel('data.xlsx', sheet = [1])
The sheet argument can be a number without quotes to specify the sheet index.
Fill both blanks to read only the first 5 rows and skip the first row of an Excel sheet.
df <- read_excel('data.xlsx', n_max = [1], skip = [2])
n_max = 5 reads only 5 rows, and skip = 1 skips the first row.
Fill all three blanks to read an Excel file, select the sheet named 'Data', and convert column names to lowercase.
df <- read_excel('data.xlsx', sheet = [1]) names(df) <- tolower([2]) print(head([3]))
Use sheet = 'Data' to select the sheet by name. Then convert column names with names(df). Finally, print the first rows of df.