Previous chapter
Write Excel FilesWriting Excel Files using writexl
Next chapter


Portable, light-weight data frame to xlsx exporter based on libxlsxwriter. No Java or Excel required.

The writexl package can be used if

  • Only Excel output is required, e.g. writing large data.frames.
  • Speed matters
  • No additional dependencies (e.g. Java) are wanted.

Use write_xlsx workhorse function:

write_xlsx(x, path = "<filename.xlsx>", col_names = TRUE)


Write data.frame mtcars to a new excel file mtcars.xlsx using write_xlsx

  • How can the car names (row names) be incorporated into the output sheet?
  • Read the data from mtcars.xlsx back and compare using all.equal()