Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect pattern matching in waterfall.R #3

Open
njosephs opened this issue Jul 9, 2020 · 0 comments
Open

Incorrect pattern matching in waterfall.R #3

njosephs opened this issue Jul 9, 2020 · 0 comments

Comments

@njosephs
Copy link

njosephs commented Jul 9, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant