Skip to content

Incorrect pattern matching in waterfall.R #3

@njosephs

Description

@njosephs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions