mario icon indicating copy to clipboard operation
mario copied to clipboard

group_by crashes with out-of-bounds column

Open pgbovine opened this issue 4 years ago • 0 comments

minimized example:

library(dplyr)
df <- airquality %>% slice(1:5)
df %>% group_by(Month, Wind > 10)

the trace contains a reference to column 7, which is out-of-bounds, since there are only 6 columns in lhs (but there are 7 columns in rhs, since a new column Wind > 10 seems to have been created):

      "mapping": [
        {
          "illustrate": "outline",
          "select": "column",
          "anchor": "lhs",
          "index": 5
        },
        {
          "illustrate": "outline",
          "select": "column",
          "anchor": "lhs",
          "index": 7
        },

[...]

        "lhs": {
          "col_names": ["Ozone", "Solar.R", "Wind", "Temp", "Month", "Day"],

pgbovine avatar Dec 09 '21 17:12 pgbovine