tmastny / leadr

https://tmastny.github.io/leadr/
MIT License
26 stars 2 forks source link

Replace `paste` with `reduce` for expression parsing #22

Closed tmastny closed 6 years ago

tmastny commented 6 years ago

Replace paste https://github.com/tmastny/leadr/blob/099fb5698ff3e4c92b3d53c7fbb306481a5ae80a/R/model_tools.R#L68 with reduce as used in this tweet: https://twitter.com/romain_francois/status/984017066654040069

tmastny commented 6 years ago

I can use !!! for unsplicing, since I want &. But if I want or, something like this works:

map2(vnames, values, ~quo(!!sym(.x) == !!.y)) %>%
  reduce(~quo(!!.x & !!.y))