How to Import data into a Data Frame from Excel File in R

When you will work with different kinds of data, you have to know different techniques of importing different kinds of data from different types of files as well as you have to know different kinds of technique of exporting data into different types of files. In this tutorial I will show you how to import data into a data file from an excel file in R with an example.

To import data into data frame from an excel file, you need to have readxl package in the R. If you do not have the package use the following command to install the package.

install.packages("readxl")

Let, there is an¬†excel file named “Iutput_excel_file_name.xlsx” in the location “C:\R Works“, then need to write the following code to import the data into a data frame in R.

library("readxl")
df<-read_xlsx("C:\R Works\Input_excel_file_name.xlsx")

I have an another article How to Export a Data Frame into Excel File in R, from where you can learn about exporting data from a data frame into an excel excel file in R.

In this tutorial, I tried to brief how to import data into data frame from excel file in R . Hope you have enjoyed the tutorial. If you want to get updated, like my facebook page https://www.facebook.com/LearningBigDataAnalytics and stay connected.

Add a Comment