Hi Joels, thanks for your help.
After I installed the openxlsx package, I wrote:
write.xlsx(daily, "daily.xlsx")
The name of my data is called 'daily'.
However, I got an error message:
Zipping up workbook failed. Please make sure Rtools is installed or a zip application is available to R. Try installr::install.rtools() on Windows.
I have now installed rtools from the internet, but I still get the same error message.