write_xlsx function: where can I find the exported file?

Dear all,

I need to export my dataset "day" in Rstudio to an Excel file. I have done the following:

write_xlsx(x = day, path = "day.xlsx", col_names = TRUE)

Luckily, there is no error or warning, so it seems like it worked. But, I can not find the file anywhere on my computer. Can somebody help me with this? Did I do something wrong with the path (I have troubles understanding how paths work)?

Thanks in advance!

It should be in your working directory. Check in the directory returned by getwd()

It will be in your working directory. You can see what that is with the command

getwd()

You can also set the location where the file is written.

write.xlsx(df, "c:/users/fjcc/documents/R/dummy.xlsx", col_names = TRUE)

It is okay to use front slashes in the path even on a Windows system.

2 Likes

This was exactly what I needed to know and do. I found it!

Thank you so much!

This topic was automatically closed 7 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.