I have a column of dates, number+date, and NA in the following format, I'd like to only keep the date part, deleting the other number in R probably using sub or gsub? Happy to accept an answer that helps me out :)
df <- data.frame(a=c(1:11), datecol=c("11 June 2018", NA, NA, "400 10 June 2017",NA,"5 05 June 2018", NA, NA, NA, NA, "25 15 May 2016"))
df.desired <- data.frame(a=c(1:11), datecol=c("11 June 2018", NA, NA, "10 June 2017",NA,"05 June 2018", NA, NA, NA, NA, "15 May 2016"))