将表格写入 Excel 工作簿时:
wb <- createWorkbook()
addWorksheet(wb, "Data")
data <- tibble(x = seq(1,10), y = c("A","B","C","D", NA, NA, NA, NA, NA, NA))
writeDataTable(wb, sheet = "Data", x = data, colNames = FALSE, withFilter = FALSE, tableStyle = "none")
saveWorkbook(wb, file = "Temp.xlsx", overwrite = TRUE)
即使colNames = FALSE
写了名称 - 只是实际的列名被“Column1”、“Column2”等替换。
有没有办法让 writeDataTable 写入表并完全省略列名 - 以便 data.frame 中的第一个数据值写入 A1(或指定的任何位置),而不是“Column1”?