R converting a character to a date -


this question has answer here:

i have character string of type dec 2016 , want convert date.

i tried:

dates1 <- c("dec 2016", "feb 2017", "nov 2018")  dates2 <- as.date(dates1,format="%b %y") 

but did not work.

thank help.

dates1 <- c("dec 2016", "feb 2017", "nov 2018")  library(zoo) dates2 <- as.date(as.yearmon(dates1))  dates2 [1] "2016-12-01" "2017-02-01" "2018-11-01" class(dates2) [1] "date" 

you should googling.


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -