Write multiple excel/csv files from a large data.frame
<p>I have a large data frame of over 500,000 rows. I wish to export it to multiple excel/csv files with a certain row limit (e.g. 100,000 rows). </p>

<p>My solution is:</p>

<pre><code>library(openxlsx)
write.xlsx(df[1:100000,], "path")
write.xlsx(df[100001:200000,], "path")
write.xlsx(df[200001:300000,], "path")
write.xlsx(df[300001:400000,], "path")
write.xlsx(df[400001:500000,], "path")
</code></pre>

<p>Is there any elegant way to do it?
Thanks</p>