Skip to content

Instantly share code, notes, and snippets.

@janeshdev
Last active December 15, 2015 00:19
Show Gist options
  • Save janeshdev/5172142 to your computer and use it in GitHub Desktop.
Save janeshdev/5172142 to your computer and use it in GitHub Desktop.
Combine date and time into one variable with POSIXct class
jd1 <- read.csv("datetime.csv")
## Then a new variable called timestamp will be added to the dataframe jd1.
jd1 <- transform(jd1, timestamp=as.POSIXct(paste(Date,Time),format="%Y/%m/%d %H:%M"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment