standard deviation of dttm values

10 views
Skip to first unread message

John Williams

unread,
May 15, 2017, 3:39:43 AM5/15/17
to lubridate
Have a tibble with ID (integer) and Edate (dttm) columns.   Need to calculate the standard deviation (in seconds, minutes, hours, or days, etc. - what ever is appropriate for human consumption) of Edates grouped by ID

E.g.

library(tidyverse)
library(lubridate)

tib %>% 
  group_by(ID) %>% 
  summarize(EdateSD = sd(Edate))

How would I make this work with lubridate?  Looking at the Timespan-class but can't quite see how to do it.

Thanks for advice!
Reply all
Reply to author
Forward
0 new messages