I'm trying to convert a factor to date but I keep getting NA values. The format of the date value I have as date is like: dd-mmm-yy. For example with the following code:
dates <- c('21-Feb-16', '22-Feb-16', '23-Feb-16')
valx <- c(100,200,300)
df.dates <- data.frame(dates, valx)
I have tried some of the examples in here, but when I try to convert the date I get an NA value
as.Date(df.dates$dates, format = "%d/%m/%Y")
[1] NA NA NA
My intention is to do a time line chart, but I cannot figure out how to convert the date properly