I'm trying to retrieve stock prices with the following code using quantmod. The code below allows me to retrieve what I need. However, when I export the CSV file, the date column (first column) appears only as a sequence of numbers. To be clear, it's fine in R when I open a data frame, but changes when exported.
from.dat <- as.Date("01/01/12", format="%m/%d/%y")
to.dat <- as.Date("12/31/17", format="%m/%d/%y")
getSymbols("GOOG", src="yahoo", from = from.dat, to = to.dat)
write.csv(GOOG, file = "Googletest.csv", row.names = TRUE)
Any ideas how to get the code to include a date? - Mike