

If you print the data object data2 to your RStudio console, you will see the following output:Īs you can see, the read_excel command returns a tibble instead of a data frame (as read.xlsx did in Example 1). iris.xlsx") # Read xlsx file with read_excel iris.xlsx" ) # Read xlsx file with read_excelĭata2 <- readxl::read_excel("C:/. ggplot2 or dplyr).įirst, we need to install and load the readxl package to R:ĭata2 <- readxl :: read_excel ( "C:/. The readxl package is part of the Tidyverse and therefore highly compatible with Tidyverse’s family of R packages (e.g.

The most popular alternative to the xlsx package (shown in Example 1) is the readxl package. Keep on reading!Įxample 2: Read xlsx File with read_excel Function (readxl Package) In Examples 2 and 3 I’m going to explain two alternative packages for importing xlsx files (Tidyverse included). However, there are several alternatives available and depending on your specific situation, you might prefer one of the other solutions. In my personal opinion, the xlsx package is the package to go if you have to deal with xlsx files in R.

You will see that it contains the iris data set that we have exported above. iris.xlsx", # Read xlsx file with read.xlsxĬall the data object data1 in your RStudio. iris.xlsx", # Read xlsx file with read.xlsxĭata1 <- xlsx::read.xlsx("C:/.
