setColumnWidth-methods | R Documentation |
Sets the width of a column in a worksheet.
## S4 method for signature 'workbook,character'
setColumnWidth(object,sheet,column,width)
## S4 method for signature 'workbook,numeric'
setColumnWidth(object,sheet,column,width)
object |
The |
sheet |
The name or index of the sheet |
column |
The index of the column to resize |
width |
The width of the specified column in units of 1/256th of a character width.
If |
Note that the arguments sheet
, column
and width
are
vectorized. As such the column width of multiple columns (potentially on
different sheets) can be set with one method call.
Martin Studer
Mirai Solutions GmbH https://mirai-solutions.ch
workbook
, setRowHeight
## Not run:
# mtcars xlsx file from demoFiles subfolder of package XLConnect
mtcarsFile <- system.file("demoFiles/mtcars.xlsx", package = "XLConnect")
# Load workbook
wb <- loadWorkbook(mtcarsFile)
# Sets the column width of the 3rd column on sheet 'mtcars'
# to 4000/256th (= 15.625) character width
setColumnWidth(wb, sheet = "mtcars", column = 3, width = 4000)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.