R - Autofit Excel column width

后端 未结 4 2023
再見小時候
再見小時候 2021-02-02 01:30

How do I autofit the column width using openxlsx?

One of my columns has a date variable (eg. 21-08-2017) and if copied using ctrl+c

4条回答
  •  Happy的楠姐
    2021-02-02 01:54

    Using XLConnect...

    setColumnWidths(WB, Sheet, column = 1:ncol(DF), width = -1)
    

    Reference: https://cran.r-project.org/web/packages/XLConnect/XLConnect.pdf

提交回复
热议问题