# create a workbook and add some sheets
wb <- wb_workbook()
wb$add_worksheet("sheet1")
write_data2(wb, "sheet1", mtcars, colNames = TRUE, rowNames = TRUE)
wb$add_worksheet("sheet2")
write_data2(wb, "sheet2", cars, colNames = FALSE)
wb$add_worksheet("sheet3")
write_data2(wb, "sheet3", letters)
wb$add_worksheet("sheet4")
write_data2(wb, "sheet4", as.data.frame(Titanic), startRow = 2, startCol = 2)
Run the code above in your browser using DataLab