I am using xlsx package Version: 0.5.7 Date: 2014-08-01. in version R 3.0.1 (2013-05-16) - the Good Sport platform: i386-w64-mingw32 / i386 (32-bit version).
I have an xlsx file containing at least 2 sheets (e.g. A and B). I need to read the data from A, edit it and save it to B. This should be done on a periodic basis.
I can read data from A with read.xlsx . After editing the data frame, I want to save it in an existing sheet B in the same xlsx file.
I am trying to use this line
write.xlsx(down, paste0(root,'/registration reports/registration complete_WK.xlsx'), sheet="data_final", col.names=T, row.names=F, append=T, showNA=F)
but he gives me this error:
Error in .jcall(wb, "Lorg/apache/poi/ss/usermodel/Sheet;", "createSheet", java.lang.IllegalArgumentException: the workbook already contains a sheet of this name
I really need to replace this existing sheet several times. How can i do this?
thanks filippo
source share