Katie
Katie

Reputation: 11

Appending the extracted time stamp to a separate column in the data frame

dtime = strptime(Group_data[, 11], "%Y-%m-%dT%H:%M:%SZ")
timestamp=strftime(dtime, format='%H:%M:%S')

I extracted the time stamp and would like to append these values as a column back to the original dataset. I am confused because I can not open up the extracted time values into a readable data frame like I can my other data. I thought I had created a variable "timestamp" so that I could then add that column of data back to the orginal dataset.

Upvotes: 0

Views: 27

Answers (1)

Rafael Neves
Rafael Neves

Reputation: 467

If I understood right, you should make:

Group_data$timestamp <- timestamp

To view the values as a column you can make on the console:

as.data.frame(timestamp)

Upvotes: 1

Related Questions