tidymodels / applicable

Quantify extrapolation of new samples given a training set

Home Page:https://applicable.tidymodels.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Output an error message when column names don't match

marlycormar opened this issue · 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