I download some stock data from yahoo. When I save this as a csv the first column (containing the dates) is lost. Any thoughts?
library (tidyverse)
library(forecast)
ftse <- getSymbols('^FTSE', auto.assign=FALSE, from = '2013-01-01', src= 'yahoo')
na.fill(ftse, "extend")
ftse_df <- as.data.frame (ftse)
ftse_df
colnames(ftse_df)<- c("open", "high", "low", "close", "volume", "adjusted")
ftse_df
write_csv(ftse_df,"C:/Users/xxx/ftse.csv")
Thanks,
Kevin
when you press Ctrl+Enter to visualise "ftse_df" do you see the first column? If not, there should be a problem above.
If you see the correct dataset, you can try this:
Hope it will work!
Cheers, Beatrice