applicable icon indicating copy to clipboard operation
applicable copied to clipboard

Output an error message when column names don't match

Open marlycormar opened this issue 5 years ago • 0 comments

Output a descriptive error message when the selector columns do not exist in the dataset. For example, in the code below apd_pca(predictors) doesn't contain columns matching "PC00[1-3]".

library(applicable)

predictors <- mtcars[, -1]
mod <- apd_pca(predictors)
autoplot(mod, matches("PC00[1-3]"))

As a result, it throws the following error.

Error: At least one layer must contain all faceting variables: component.

  • Plot is missing component
  • Layer 1 is missing component

marlycormar avatar Jul 08 '20 05:07 marlycormar