+2 votes
in Programming Languages by (66.2k points)
Which R package and function should I use to read an excel file?

1 Answer

+2 votes
by (281k points)
selected by
 
Best answer

You can use the read_excel() function of the R package "readxl" to read an excel file. The function returns a tibble (tbl_df) object. Depending on the file extension, you can also use either read_xls() or read_xlsx() directly.

Here is an example:

library(readxl)
tab_df <- read_excel("myfile.xlsx")

tab_df1 <- read_xlsx("myfile.xlsx")


...