How to order multiple tables by date and time in R

I am working with a data frame in R , which has two coulmns. ONe is for date and the other is for time. I want to order it first by the date and then by the time.
Unfortunately, R has to be told that the tables that I am considering are of the type date. Then it orders it beautifully.

df<-df[order(as.Date(df$DATE,format=”%d/%m/%Y”)),,drop=FALSE]

Nice. Simple. Easy.

 

Link : https://stackoverflow.com/questions/17864490/order-dataframe-chronologically-based-on-dates-which-are-formatted-d-m-y/17864592#17864592?newreg=1a134488a31743e9af3ba4c720bc4d3f

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s