Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

How to convert data from character to a standard date format in R?

$
0
0

@sid100158 wrote:

I am currently trying to plot a heatmap in R using latitude and longitude given in the data set and time as a third attribute .But in my data , date is in form of character .I want to know how I can convert the date in the form by which R can undertand it.

mvt = read.csv("mvt.csv", stringsAsFactors=FALSE)
 str(mvt)
'data.frame':   191641 obs. of  3 variables:
 $ Date     : chr  "12/31/12 23:15" "12/31/12 22:00" "12/31/12 22:00" "12/31/12 22:00" ...
 $ Latitude : num  41.8 41.9 42 41.8 41.8 ...
 $ Longitude: num  -87.6 -87.7 -87.8 -87.7 -87.6 ...

As we can see that Date attribute is in character form .I want to convert it in the form by which R can understand.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles