How can I insert a blank row or column into an Excel sheet, moving the data already contained in the sheet down or to the right, as needed? My pre-existing tables are linked to graphs in the Excel, so the new columns/rows need to be inserted in the middle to preserve the graphs.
I have tried to achieve this using createRow (from xlsx package) but got the following error message: "Error in .jcall(sheet, "Lorg/apache/poi/ss/usermodel/Row;", "createRow", : RcallMethod: cannot determine object class".
# Load workbook
wb <- loadWorkbook("test.xlsx")
#get sheets
sheets <- getSheets(wb)
#create row
row <- createRow(sheet = "Sheet1", rowIndex = 12:14)
A similar question was posted here last year. @cole responded and indicated that it is possible but difficult. Any pointers would be appreciated. @cole, if possible, can you elaborate on your response to the linked post ("You definitely can do this latter approach, but it will likely require a bit of ugly programming on your part.")?
Thank you!