library("rquery")
library("rqdatatable")

Roughly we consider extend() safe to fold, and select_rows() unsafe (as this may eliminate guards). So we combine extend() steps, but not select_rows() steos.

d2 <- data.frame(
    col1 = c(0, 1),
    col2 = c(1, 0)
)


ops2 <- local_td(d2) %.>%
  extend(., x := 1) %.>%
  extend(., x := 2) %.>%
  select_rows(., col2 > 0) %.>%
  select_rows(., col1 / col2 > 0)

ops2
d2 %.>% ops2


WinVector/rquery documentation built on Aug. 24, 2023, 11:12 a.m.