I have been learning R through a series of videos on Google Developers youtube channel.
But I got stuck on https://www.youtube.com/watch?v=cx_3zWo4sUs&list=PLOU2XLYxmsIK9qQfztXeybpHvru-TrqAP&index=9
Particularly the transformation of the factor into date. It always ends up as NA.
The code I tried is the same as in the video, and I also tried first translating it to char. But nothing works.
stocks <- read.delim("stocks.txt")
str(stocks)
summary(stocks)
head(stocks$date, 20)
txt.date <- as.character(stocks$date)
txt.date
head(txt.date, 10)
s.date <- as.Date(txt.date, "%d-%b-%y")
s.date
s.date <- as.Date(stocks$date, format = "%d-%b-%y")
s.date
The file stocks.txt is available at http://rfunction.com/archives/2859 if needed.
I expect I am just doing something stupid as I don't yet know the language, but I could use some help.