Sid
Sid

Reputation: 17

How to speedup write.xlsx process of excel in R

I am in need of writing my output to an excel file in R. The t_content has around 401104 rows and 200 columns.

write.xlsx(t_content, paste0("../output/",'Content.xlsx'),
           col.names = T, append = TRUE)

This command takes a very long time to complete the task. Any other alternative way?

Upvotes: 0

Views: 695

Answers (2)

whooshboosh
whooshboosh

Reputation: 91

The data.table::fwrite command is very fast, and can show you a progress bar, but it gives you a .csv file which can then be used with excel.

Upvotes: 0

SEAnalyst
SEAnalyst

Reputation: 1211

You might want to try write_xlsx() from the writexl package.

writexl::write_xlsx(t_content, paste0("../output/",'Content.xlsx'))

Upvotes: 1

Related Questions