openxlsx
openxlsx copied to clipboard
Copying workbooks and performing changes on the copy destroys/applies the changes also to the original
df <- data.frame(x = 1:3)
master_wb <- buildWorkbook(df)
readWorkbook(master_wb, sheet = 1)
x
1 1
2 2
3 3
copy <- copyWorkbook(master_wb)
deleteData(copy, sheet = 1, cols = 1, rows = 2)
readWorkbook(copy, sheet = 1)
x
1 2
2 3
readWorkbook(master_wb, sheet = 1)
x
1 2
2 3
IMO, I would never expect a change made to a certain object/entity being applied to another object/entity.