Hi Farnoosh,

Use ?as.Date()
dat1<- read.table(text="V1
2012-01-12 08:23:00
2012-01-19 15:29:00",sep=",",header=TRUE,stringsAsFactors=FALSE)


dat1$V1<- as.Date(dat1$V1)
 dat1
#          V1
#1 2012-01-12
#2 2012-01-19
A.K.





________________________________
From: farnoosh sheikhi <farnoosh...@yahoo.com>
To: "smartpink...@yahoo.com" <smartpink...@yahoo.com> 
Sent: Wednesday, October 2, 2013 1:38 AM
Subject: Removing time and min from Date



Hi Arun,

I have a variable including time and date together like below.
I want to just keep the date part (2012-01-12 ) and drop the hour and minutes.

V1
2012-01-12 08:23:00
2012-01-19 15:29:00



Thanks a lot. 

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to