EIX
EIX copied to clipboard
Incorrect pattern matching in waterfall.R
Line 106 of waterfall.R is prefixes = unique(gsub("\\.+[1-9]", "", colnames(df[, grepl("\\:", colnames(df))]))). My understanding is that this is supposed to identify the columns of df that are interactions.
If I have the interaction foo:bar, then gsub("\\.+[1-9]", "", "foo:bar") returns foo:bar.
However, if the interaction is foo.1:bar.2, thengsub("\\.+[1-9]", "", "foo.1:bar.2") returns foo1:bar1. This throws an error because . has been dropped from the names of the variables, which prevents startsWith from finding any matches on line 107.