How do I convert a factor into date format

0 votes
I imported a CSV file containing dates from a SQL query, however the dates are actually date-time values, which R does not recognise:

> mydate

1/15/2006 0:00:00 0:00:00 0:00:00 0:00:00 0:00:00 0:00:00

Levels: 2373 0:00:00 1/1/2006 0:00:00 0:00:00 1/1/2007 0:00:00 0:00:00 1/1/2008 0:00:00... 0:00:00 on September 9, 2012

> the class (mydate)

"Factor" is the first word that comes to mind.

as.Date > (mydate)

charToDate(x) has an error:

The character string is not in an unambiguous standard format.

What is the best way to convert mydate to date format? (It's not necessary for me to mention the time component.)
6 days ago in Data Analytics by avinash
• 860 points
13 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Data Analytics

0 votes
1 answer

How can I convert a factor variable to numeric in R ?

A factor variable can be converted to ...READ MORE

answered Sep 19, 2018 in Data Analytics by shams
• 3,660 points
400 views
0 votes
1 answer

How do I convert a dataframe to a list?

For doing this first you'll have to ...READ MORE

answered Sep 19, 2018 in Data Analytics by Abhi
• 3,720 points
3,792 views
+1 vote
1 answer

How to convert a list of vectors with various length into a Data.Frame?

We can easily use this command as.data.frame(lapply(d1, "length< ...READ MORE

answered Apr 4, 2018 in Data Analytics by DeepCoder786
• 1,720 points
782 views
0 votes
1 answer

How to convert a text mining termDocumentMatrix into excel or csv in R?

By assuming that all the values are ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
956 views
0 votes
1 answer

How do I become a data scientist step by step?

I am assuming that you are a ...READ MORE

answered Jul 26, 2018 in Data Analytics by Abhi
• 3,720 points
267 views
+1 vote
1 answer

How do I perform feature selection in a disease prediction data set?

Feature selection is based equally upon logic ...READ MORE

answered Aug 20, 2018 in Data Analytics by Abhi
• 3,720 points
343 views
0 votes
1 answer

Big Data transformations with R

Dear Koushik, Hope you are doing great. You can ...READ MORE

answered Dec 18, 2017 in Data Analytics by Sudhir
• 1,610 points
422 views
0 votes
2 answers

Transforming a key/value string into distinct rows in R

We would start off by loading the ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,660 points
467 views
0 votes
1 answer

Finding frequency of observations in R

You can use the "dplyr" package to ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,660 points
4,280 views
0 votes
1 answer

Left Join and Right Join using "dplyr"

The below is the code to perform ...READ MORE

answered Mar 27, 2018 in Data Analytics by Bharani
• 4,660 points
490 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP