Clears worksheets with specified names or indices in a
1 2 3 4
The name or the index of the worksheet to clear
Clearing a worksheet means to clear all the cells in that worksheet. Consequently, the saved workbook should be smaller in size. Clearing a worksheet can be useful if data sets in a worksheet need to be replaced, i.e. data are first read, modified in R and finally written back to the worksheet. Without clearing the worksheet first, (parts of) the original data may still be visible if they occupied a larger range of the worksheet.
Mirai Solutions GmbH http://www.mirai-solutions.com
1 2 3 4 5 6 7 8 9 10 11 12 13
# mtcars xlsx file from demoFiles subfolder of # package XLConnect demoExcelFile <- system.file("demoFiles/mtcars.xlsx", package = "XLConnect") # Load workbook wb <- loadWorkbook(demoExcelFile) # Clear worksheets named 'mtcars' and 'mtcars2' clearSheet(wb, sheet = c("mtcars", "mtcars2")) # Clear 3rd worksheet clearSheet(wb, sheet = 3)
Loading required package: XLConnectJars OpenJDK 64-Bit Server VM warning: Can't detect initial thread stack location - find_vma failed XLConnect 0.2-12 by Mirai Solutions GmbH [aut], Martin Studer [cre], The Apache Software Foundation [ctb, cph] (Apache POI, Apache Commons Codec), Stephen Colebourne [ctb, cph] (Joda-Time Java library), Graph Builder [ctb, cph] (Curvesapi Java library) http://www.mirai-solutions.com , http://miraisolutions.wordpress.com ZoneInfo: /usr/share/javazi/ZoneInfoMappings (Permission denied) Warning message: system call failed: Cannot allocate memory
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.