0

I'm having real trouble running the function write.xlsx - the error "could not find function "write.xlsx"

I've already tried to:

  • Install the packages xlsx, readxl, writexl, XLConnect but no one of these is working.
  • Install Java JRE, but it's not working as well

Have you guys ever had a similar problem before? I'm really needing to start running those flows which are properly working in other machines.

PS: I'm a beginner in the R coding

bassk
  • 1
  • Installing a package is not the same as loading it. Perhaps `library(openxlsx)` and then reattempt your code. Especially for beginners, I tend to recommend `writexl` for its simplicity and `openxlsx` for more flexibility, and avoid `xlsx` and `XLConnect` for their reliance on java, which can be an onerous requirement for many users, though I'm confident they have capabilities that the first two packages do not. – r2evans Feb 10 '23 at 20:02

1 Answers1

0

After installing the package xlsx you should also load the library in order to use the function, like this:

library(xlsx)

If you're just going to use the function one time you can call it without loading the library first like this:

xlsx::write.xlsx(data, file = "file.xlsx")

Hope this helps

kofm
  • 125
  • 11