Skip to content

fine gray error: "undefined columns selected" #43

Description

@nickp60

In cases where column names are either numeric or contain weird characters, running FLORAL Fine-Gray models return an error:

Error in `[.data.frame`(df_FG, , colnames(x)) : 
  undefined columns selected

This is due to how the code internally sanitizing the column names. It might be worth adding a line of validation, or at least a little warning/stop error letting the user know why the error is occurring. I put the following just before the newx <- as.matrix(df_FG[, colnames(x)]) line:

                if (!colnames(x) %in% colnames(df_FG)){
                    warning("Sanitized column names do not match original column names; please simplify column names")
                } 

Metadata

Metadata

Assignees

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