Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 204922

R help converting factor to date

$
0
0

I imported a csv file with dates from a SQL query, but the dates are really date-time values and R doesn't seem to recognize them as dates. How do I convert them to dates? (I don't need to include the time portion.)

> mydate
[1] 1/15/2006 0:00:00
2373 Levels: 1/1/2006 0:00:00 1/1/2007 0:00:00 1/1/2008 0:00:00 ... 9/9/2012 0:00:00
> class(mydate)
[1] "factor"> as.Date(mydate)
Error in charToDate(x) : 
  character string is not in a standard unambiguous format

How do I convert mydate to a date?


Viewing all articles
Browse latest Browse all 204922

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>