隐藏第X行之后的所有行

时间:2018-09-13 04:57:07

标签: r openxlsx

是否可以在某行之后隐藏工作表中的所有行?

library("openxlsx")

# Create a workbook
wb <- createWorkbook()
# Add worksheet
addWorksheet(wb, sheetName = "test", gridLines = FALSE)
# "Hide" all rows after row 37
setRowHeights(wb, 1, 38:1048576, 0)
# Write workbook
saveWorkbook(wb, "test.xlsx", overwrite = TRUE)

# inspect file size
file.info("test.xlsx")
#              size isdir mode               mtime               ctime               atime exe
# test.xlsx 2621280 FALSE  666 2018-09-13 14:54:10 2018-09-13 14:54:07 2018-09-13 14:54:07  no

似乎效率很低,并且似乎使输出变得非常大(尝试在Excel中打开它时很慢)。我认为它没有隐藏它,实际上只是将行高更改为0?

0 个答案:

没有答案