How to Export a Data Frame into 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 export a data frame into an excel file in R with an example.

To export data frame into an excel file you need to have writexl package in the R. If you do not have the package use the following command to install the package.

install.packages("writexl")

Let you have a data frame named df and you want to export into a excel file named “output_excel_file_name.xlsx” in the location “C:\R Works\” then need to write the following code to do that.

library("writexl")
write_xlsx(df,"C:\\R Works\\output_excel_file_name.xlsx")

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

In this tutorial, I tried to brief how to export data frame into 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