Skip to content
Prev 28531 / 29559 Next

merge ggplots into one with pipeline commands

On Thu, Feb 4, 2021 at 6:01 AM <r-sig-geo-request at r-project.org> wrote
This will do it. Enclosing the pipe expression in { } lets you put the
piped-in variable where you need it using '.'.

dat %>%
  filter(fac==1) %>%
  { p1 +
    geom_point(data=., aes(x=lon, y=lat))
  }

Kent Johnson
Cambridge, MA