Summarize dataframe by day from timestamp
I have a dataset data that contains a timestamp and a suite of other variables with values at each timestamp. I am trying to use ddply within plyr to create a new dataframe that is the summary (e.g. mean) of a variable by the group day. How can I get ddply to group by day? Or how can I can create a group or grouping variable from the day (%d) within the timestamp? The result dataframe would consist of the average values per day for each day present in data . library(plyr) data <- read.csv("data.csv", header=T) data$TIMESTAMP <- strptime(data$TIMESTAMP, "%m/%d/%Y %H:%M") ddply(data,.(DAY)