write_xlsx function: where can I find the exported file?

excel
#1

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!

0 Likes

#2

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

0 Likes

#3

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

#4

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

Thank you so much!

0 Likes