dates

Summarising Dates with Missing Values

This blog post is just a note that when you try to do a grouped summary of a date variable but some groups have all missing values, it will return Inf. This means that the summary will not show up as an NA and this can cause issues in analysis if you are not careful. library(tidyverse) df <- tibble::tribble( ~id, ~dt, 1L, "01/01/2001", 1L, NA, 2L, NA, 2L, NA ) %>% mutate(dt = dmy(dt)) z1 <- df %>% group_by(id) %>% summarise(dt_min = min(dt, na.