[R] Converting the data in year month day hour and minutes to date

2013-02-19 Thread Janesh Devkota
Hi , I am trying to convert the date as factor to date using as.date function in R. I have the date in the following format 2008-01-01 02:30 I tried to use the following command : as.Date(mydata$Date, format=%y-%m-%d ) Can somebody help me with this ? I was able to convert the

Re: [R] Converting the data in year month day hour and minutes to date

2013-02-19 Thread Uwe Ligges
On 19.02.2013 18:47, Janesh Devkota wrote: Hi , I am trying to convert the date as factor to date using as.date function in R. I have the date in the following format 2008-01-01 02:30 I tried to use the following command : as.Date(mydata$Date, format=%y-%m-%d ) Can somebody help me

Re: [R] Converting the data in year month day hour and minutes to date

2013-02-19 Thread Pete Brecknock
jdbaba wrote Hi , I am trying to convert the date as factor to date using as.date function in R. I have the date in the following format 2008-01-01 02:30 I tried to use the following command : as.Date(mydata$Date, format=%y-%m-%d ) Can somebody help me with this

Re: [R] Converting the data in year month day hour and minutes to date

2013-02-19 Thread Rui Barradas
Hello, Try the following. x - 2008-01-01 02:30 as.POSIXct(x, format = %Y-%m-%d %H:%M) Hope this helps, Rui Barradas Em 19-02-2013 17:47, Janesh Devkota escreveu: Hi , I am trying to convert the date as factor to date using as.date function in R. I have the date in the following format

Re: [R] Converting the data in year month day hour and minutes to date

2013-02-19 Thread Jeff Newmiller
It is possible to squeeze a square peg into a round hole, but often you will not be satisfied with the result. Date is for... surprise, dates. You may want to use the chron package or the POSIXct type. The R Journal of June 2004 (Volume 4/1) R Help Desk column is recommended reading.

Re: [R] Converting the data in year month day hour and minutes to date

2013-02-19 Thread John Kane
You need to convert the factor to character. as.Date( as.character(mydata$Date), %Y-%m-%d) should do it. John Kane Kingston ON Canada -Original Message- From: janesh.devk...@gmail.com Sent: Tue, 19 Feb 2013 11:47:04 -0600 To: r-help@r-project.org Subject: [R] Converting the data