messydates icon indicating copy to clipboard operation
messydates copied to clipboard

Logical comparison for row wise filtering when using `dplyr` not working

Open henriquesposito opened this issue 1 year ago • 1 comments

manyhealth::memberships$HUGGO_MEM %>%
  dplyr::filter(messydates::year(Begin) > "1999" & messydates::year(Begin) < "2010") %>% 
  dplyr::filter(stateID == "USA" | stateID == "CHN") %>%
  as_tidygraph() %>%
  mutate_ties(color = ifelse(to == 47, "China", "USA")) %>%
  autographr(edge_color = "color")

henriquesposito avatar Mar 01 '24 15:03 henriquesposito

This issues was related to comparing 'mdate' objects and character objects (e.g.as_messydate("2010-09-10") > "2009"). This feature has been added now. The following should work @jaeltan . Thank you.

manyhealth::memberships$HUGGO_MEM %>% dplyr::filter(Begin > "1999" & Begin < "2010", stateID == "USA" | stateID == "CHN") %>% as_tidygraph() %>% mutate_ties(color = ifelse(to == 47, "China", "USA")) %>% autographr(edge_color = "color")

henriquesposito avatar Mar 01 '24 16:03 henriquesposito