The code below gives the error message
Error: Problem with `summarise()` column `xxx`.
i `xxx = nrow(filter(cur_data(), abc2 > 0))`.
x Internal error in `df_slice()`: Columns must match the data frame size.
library(tidyverse)
library(glue)
lookAhead = 2
colnm = sym(glue("abc{lookAhead}"))
set.seed(123)
df <- data.frame(abc1 = rnorm(5), abc2 = rnorm(5))
df %>%
summarise(n = n(),
xxx = nrow(filter(cur_data(), {{colnm}}>0))
)
Reversing the two summarise parameters fixes the problem.
Any ideas what the error means here?
(Attribution: Thanks to Ronak Shah for his efforts of getting my original problem down to this state.)