Research breakthrough possible @S-Logix pro@slogix.in

Office Address

  • 2nd Floor, #7a, High School Road, Secretariat Colony Ambattur, Chennai-600053 (Landmark: SRM School) Tamil Nadu, India
  • 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
Read an Excel File in R
Write an Excel File in R