Merge Excel spreadsheets into just one in R

I have 4 separate Excel spreadsheets, and I would like to unify them, that is, leave them in just one. It is possible? As it is, I'm doing it like this:

library(readxl)

x<-read_excel('C:/Users/Jose/Desktop/Calculation 1.xlsx',sheet = "Calculation")
y<-read_excel('C:/Users/Jose/Desktop/Calculation 2.xlsx',sheet = "Test")
z<-read_excel('C:/Users/Jose/Desktop/Calculation 3.xlsx',sheet = "Part")
w<-read_excel('C:/Users/Jose/Desktop/Calculation 4.xlsx',sheet = "Softwares")

And I would like to transform it into just one spreadsheet, that way it would be 4 tabs, Calculation, Test, Part and Softwares.

Here is an example of writing two data frames, df1 and df2, into a newly created Excel Workbook, putting each data frame in its own sheet. I used the package openxlsx.

library(openxlsx)
wb <- createWorkbook()
addWorksheet(wb,"Calculation")
writeData(wb,sheet = "Calculation", x=df1)
addWorksheet(wb,"Test")
writeData(wb,sheet = "Test", x=df2)
saveWorkbook(wb,file = "AllData.xlsx")

Thanks for reply @FJCC !

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.