can you guys help me to solve this problem: I want to export data into at new sheet in an already existing Excel file. Right now I have the following code:
openxlsx::write.xlsx(ft, file = "GME.xlsx", sheetName = period, append = TRUE)When I run this code it just created an Excel file, but I can't seem to make it add sheets when I run the code with other versions of the "ft" data frame
1 Answer
you can use xlsx package for that. Could you try with below code ?
library(xlsx)
write.xlsx(dataframe1, file="filename.xlsx", sheetName="sheet1")
write.xlsx(dataframe2, file="filename.xlsx", sheetName="sheet2", append=TRUE) 8