I have a data frame of integer-count observations listed by date and time interval. I want to find the median of these observations by date using the dplyr package. I've already formatted the date column correctly, and used group_by like so:
data.bydate <- group_by(data.raw, date)
When I use summarise() to find the median of each date group, all I'm getting are a bunch of zeroes. There are NA's in the data, so I've been stripping them with na.rm = TRUE.
data.median <- summarise(data.bydate, median = median(count, na.rm = TRUE)
Is there another way I should be doing this?
You can do something like,