I’d do it with lubridate
and plyr
, rounding dates down to the nearest month to make them easier to plot:
library(lubridate)
df <- data.frame(
date = today() + days(1:300),
x = runif(300)
)
df$my <- floor_date(df$date, "month")
library(plyr)
ddply(df, "my", summarise, x = mean(x))
Related Contents:
- Determine Whether Two Date Ranges Overlap
- Daylight saving time and time zone best practices [closed]
- How to prevent ifelse() from turning Date objects into numeric objects
- strptime, as.POSIXct and as.Date return unexpected NA
- Format current date and time in VBScript
- How do I convert a date/time string to a DateTime object in Dart?
- How to convert Excel date format to proper date in R
- Kotlin DateTimeParseException
- Best way to store date/time in mongodb
- Split date-time column into Date and time variables
- How to flatten / merge overlapping time periods
- How to get the current time as datetime
- How to parse milliseconds?
- efficiently generate a random sample of times and dates between two dates
- Change timezone in a POSIXct object
- How do you convert POSIX date to day of year?
- Split time series data into time intervals (say an hour) and then plot the count
- What’s the difference between ISO 8601 and RFC 3339 Date Formats?
- calculating time difference in R
- How do you specify the date format used when JAXB marshals xsd:dateTime?
- Why are date/time values interpreted incorrectly when patching/saving?
- Date conversion from POSIXct to Date in R
- Convert UTC string to time object
- Convert 12-hour date/time to 24-hour date/time
- How do I convert an interval into a number of hours with postgres?
- converting datetime string to POSIXct date/time format in R
- Pythonic way to combine datetime.date and datetime.time objects
- How to format a DateTime in PowerShell
- Understanding dates and plotting a histogram with ggplot2 in R
- Parsing of Ordered Timestamps in Local Time (to UTC) While Observing Daylight Saving Time
- What is the difference between UTC and GMT?
- Handling dates when we switch to daylight savings time and back
- How to join two dataframes by nearest time-date?
- How to Parse Year + Week Number in R?
- IE JavaScript date parsing error
- Best practices with saving datetime & timezone info in database when data is dependant on datetime
- How to make time difference in same units when subtracting POSIXct
- Find all date ranges for overlapping start and end dates in R [duplicate]
- R datetime series missing values
- How to get timezone, Language and County Id in flutter by the location of device in flutter?
- Round a POSIX date (POSIXct) with base R functionality
- How precise is the internal clock of a modern PC?
- How to convert SQL Server’s timestamp column to datetime format
- Filtering Pandas DataFrames on dates
- Generate an incrementally increasing sequence like 112123123412345
- Speeding up the performance of write.table
- Function to calculate R2 (R-squared) in R
- Moving average of previous three values in R
- Handling java.lang.OutOfMemoryError when writing to Excel from R
- Convert two-digit years to four-digit years with correct century