How to convert the data such as "20nov2016" in the date?
the variable was saved as factor; I did it:
df$airdates = as.character(df$airdates)
library(lubridate)
as_date(df$airdates)
tmp2 = gsub("\n", "", df$airdates[1]) %>% trimws() #replaced and removed
extra marks
tmp2 = gsub("\\.", "", tmp2) #replaced and removed extra marks
tmp2 = gsub(" ", "", tmp2) #replaced and removed extra marks
tmp2 = tolower(tmp2) #data look like "20nov2016"
as.Date(tmp2, format = "%d%h%Y") #in this step it creates NA
R refuses to take it as a date and create NA`s. What am I doing wrong?