EIX icon indicating copy to clipboard operation
EIX copied to clipboard

Incorrect pattern matching in waterfall.R

Open njosephs opened this issue 5 years ago • 0 comments

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.

njosephs avatar Jul 09 '20 21:07 njosephs