I have a file that gives me the date along with the time in the column.
I only want the date, but in Year-month-day format.
vmax1$date <- substr(vmax1$date,1,10)
myformat <- "%y-%m-%d" vmax1$date<-as.Date(vmax1$date,myformat) str(vmax1)
Here is the code I use, but it just changes the date column to NAs instead of the correct format