wb <- createWorkbook()
addWorksheet(wb, "S1")
addWorksheet(wb, "S2")
writeDataTable(wb, 1, x = iris[1:30,])
writeDataTable(wb, 2, x = iris[1:30,], xy = c("C", 5))
## landscape page scaled to 50\%
pageSetup(wb, sheet = 1, orientation = "landscape", scale = 50)
## portrait page scales to 300\% with 0.5in left and right margins
pageSetup(wb, sheet = 2, orientation = "portrait", scale = 300, left= 0.5, right = 0.5)
saveWorkbook(wb, "pageSetupExample.xlsx", overwrite = TRUE)
Run the code above in your browser using DataLab