R results to Excel

Hi guys, I'm fairly new to the R community since I just started working with it 2 week ago.

I'm responsible for calculating KPI's, but at the time we manually insert the output into excel and do some manual calculations. We work with dataframes of up to 3.8 million records so we have to do it in R.

What I want to achieve (to make a really good impression in my first month :)) is to automatically write the output of my results to the Excel file which is used to determine the KPI's. Higher management wants a excel file since they don't know how to work with R.

We have 3 huge dataframes which have to be split up into multiple segments and then compared to each other. Each segment is imported to excel using the write.csv(...) function. Is it possible to write the new segments directly into the existing excel file (not as csv but as normal output)? So I just want to run the same code every week with one click and generate the excel file needed for analysis automatically.

Another aspect that I would like to automate is that I manually have to look for the total number of observations. (e.g df1 <- 31931236 observations etc. --> go to excel and change the number), is it possible to automatically insert this number into row Sheet 1, D2 for example? Assuming that the file names remain the same every week.

Do you guys maybe have some tips for tutorials on this subject?

I would love to hear from you! :slight_smile:

for writing directly to excel, there are several packages, such as writexl, WriteXLS, openxlsx, xlsx. I guess one problem you may face, with such huge files, is memory. So check which one of those provides functions that are more memory efficient

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.