R: Append a worksheet to an excel workbook without reading the entire workbook

一曲冷凌霜 提交于 2020-02-05 08:25:12
问题 I have a 26 mb excel workbook to which I am trying to add a 42 kb worksheet. Using the openxlsx package, I have the following code: wb_object <- loadWorkbook(to_name2) addWorksheet(wb_object, "New Data") writeData(wb_object, sheet = "New Data", m_data) saveWorkbook(wb_object, to_name2, overwrite = TRUE) What I have noticed is that this code takes about 2 minutes to execute. I believe R is reading in the entire 26 mb file and then appending the 42 kb worksheet. Is there any way to append the