Saving an r dataframe to an excel worksheet

I am trying to transfer my dataset from r to an excel file. I have read through everything on here, and I am still getting the same error. Any help in this matter is greatly appreciated.

Here is my code:
write_xlsx( county, "C:/Users/tj370/OneDrive/Documents" = tempfile(fileext = ".xlsx"),
col_names = TRUE, format_headers = TRUE, use_zip64 = FALSE)

Here is the error:
Error in write_xlsx(county, C:/Users/tj370/OneDrive/Documents = tempfile(fileext = ".xlsx"), :
unused argument (C:/Users/tj370/OneDrive/Documents = tempfile(fileext = ".xlsx"))

This is not valid syntax, maybe this is what you are trying to do?

paste0("C:/Users/tj370/OneDrive/Documents", tempfile(fileext = ".xlsx"))
#> [1] "C:/Users/tj370/OneDrive/Documents/tmp/Rtmp1kIrQ6/file2e633d3ea64c.xlsx"

Created on 2021-05-16 by the reprex package (v2.0.0)

Thank you! You are awesome! :clap: :clap:

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.