The final product is an Excel CSV spreadsheet which has more than 250 columns. I was wondering if there was a way to determine the column width in Excel from R?
I am using write.csv2, which produces column width in excel all equal to 8,43.
write.csv2(df, na = "", file= "Final.csv")
If possible I am looking for a trick to vary all of them at once or only specific ones. Is running VBA from R my only option?
Thank you for your help!
*.csvby definition discards all the formatting information. So when you open such a file in Excel, you get Excel's default column widths. If you want to format, you must save as*.xlsor*.xlsx.xlsxmentioned in the accepted answer, you can use theopenxlsxpackage. I prefer this one because it does not depend onrJava.