#5, First Floor, 4th Street , Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to Read and Write an Excel File in R?
Description

To Read and Write an Excel File using R programming.

Process

   R Package :xlsx

   R Package : openxlsx -- for big excel file.

   R Function to read : xlsx()

   R Function to write : xlsx()

Sapmle Code

#Reading Excel File

#Get and Set Working Directory
print(getwd())
setwd(“/home/soft13”)
getwd()

#Read file from Excel
#install.packages(“xlsx”)
library(“xlsx”)
dataSet<-read.xlsx(“ExcelReadData.xlsx”,sheetIndex=1)
print(dataSet)
View(dataSet)

#Write data into an Excel File
readData<-read.xlsx(“ExcelWriteData.xlsx”,sheetIndex=1)
write.xlsx(readData,”ExcelOutput.xlsx”,append=FALSE)

Screenshots