# ----
setwd("F:/Business Analytics/Shares Monitor")
getSymbols("TATACONSUM.NS", src="yahoo")
library("writexl")
write_xlsx("TATACONSUM.NS","F:/Business Analytics/Shares Monitor//Stock_TATACONSUM-NS.xlsx")
# ----
I have written the above code to download the shares information data of a particular company and export it into Excel Sheet. When I run this script. it is creating the expected result and it is shows the Data in RStudio Environment. But it shows following error and does not export it into excel sheet :
Error in write_xlsx("TATACONSUM.NS", "F:/Business Analytics/Shares Monitor//Stock_TATACONSUM-NS.xlsx") :
Argument x must be a data frame or list of data frames
Could someone please tell me what am I missing in my code.