* using log directory ‘/Users/ripley/R/packages/tests-devel/tidyrules.Rcheck’ * using R Under development (unstable) (2025-12-23 r89222) * using platform: aarch64-apple-darwin25.2.0 * R was compiled by Apple clang version 17.0.0 (clang-1700.6.3.2) GNU Fortran (GCC) 14.2.0 * running under: macOS Tahoe 26.2 * using session charset: UTF-8 * using option ‘--no-stop-on-test-error’ * checking for file ‘tidyrules/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘tidyrules’ version ‘0.2.7’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘tidyrules’ can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking code files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking examples ... ERROR Running examples in ‘tidyrules-Ex.R’ failed The error most likely occurred in: > ### Name: augment.rulelist > ### Title: Augment a rulelist > ### Aliases: augment.rulelist > > ### ** Examples > > # Examples for augment ------------------------------------------------------ > library("magrittr") > > # C5 ---- > att = modeldata::attrition > set.seed(100) > train_index = sample(c(TRUE, FALSE), nrow(att), replace = TRUE) > > model_c5 = C50::C5.0(Attrition ~., data = att[train_index, ], rules = TRUE) > tidy_c5 = + model_c5 %>% + tidy() %>% + set_validation_data(att[!train_index, ], "Attrition") > > tidy_c5 ---- Rulelist -------------------------------- ▶ Keys: trial_nbr ▶ Number of distinct keys: 1 ▶ Number of rules: 23 ▶ Model type: C5 ▶ Estimation type: classification ▶ Is validation data set: TRUE rule_nbr trial_nbr LHS RHS support confidence lift 1 1 1 ( Age > 30 ) & ( DistanceF… No 69 0.986 1.2 2 2 1 ( DistanceFromHome <= 12 )… No 149 0.960 1.1 3 3 1 ( Department == 'Research_… No 211 0.953 1.1 4 4 1 ( Age > 30 ) & ( DistanceF… No 249 0.948 1.1 5 5 1 ( JobInvolvement %in% c('M… No 353 0.944 1.1 6 6 1 ( OverTime == 'No' ) & ( S… No 263 0.943 1.1 7 7 1 ( Education %in% c('Master… No 101 0.942 1.1 8 8 1 ( OverTime == 'No' ) & ( R… No 95 0.938 1.1 9 9 1 ( BusinessTravel %in% c('N… No 352 0.915 1.1 10 10 1 ( Education %in% c('Below_… No 265 0.910 1.1 # ℹ 13 more rows ----------------------------------------------> > augment(tidy_c5) %>% + tidytable::unnest(augmented_stats, names_sep = "__") %>% + tidytable::glimpse() Rows: 23 Columns: 10 $ rule_nbr 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,… $ trial_nbr 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, … $ LHS "( Age > 30 ) & ( DistanceFromHome <= 12 )… $ RHS No, No, No, No, No, No, No, No, No, No, Ye… $ support 69, 149, 211, 249, 353, 263, 101, 95, 352,… $ confidence 0.9859155, 0.9603000, 0.9531000, 0.9482000… $ lift 1.2, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.… $ augmented_stats__support 77, 122, 245, 282, 376, 305, 84, 111, 390,… $ augmented_stats__confidence 0.9220779, 0.9098361, 0.9346939, 0.9113475… $ augmented_stats__lift 9.3667749, 1.0091812, 1.0367533, 1.0108577… > > # augment with custom aggregator > augment(tidy_c5,output_counts = list(table(Attrition))) %>% + tidytable::unnest(augmented_stats, names_sep = "__") %>% + tidytable::glimpse() Rows: 23 Columns: 11 $ rule_nbr 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, … $ trial_nbr 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, … $ LHS "( Age > 30 ) & ( DistanceFromHome <= 1… $ RHS No, No, No, No, No, No, No, No, No, No,… $ support 69, 149, 211, 249, 353, 263, 101, 95, 3… $ confidence 0.9859155, 0.9603000, 0.9531000, 0.9482… $ lift 1.2, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1,… $ augmented_stats__support 77, 122, 245, 282, 376, 305, 84, 111, 3… $ augmented_stats__confidence 0.9220779, 0.9098361, 0.9346939, 0.9113… $ augmented_stats__output_counts <>, <>, < 9.3667749, 1.0091812, 1.0367533, 1.0108… > > # rpart ---- > set.seed(100) > train_index = sample(c(TRUE, FALSE), nrow(iris), replace = TRUE) > > model_class_rpart = rpart::rpart(Species ~ ., data = iris[train_index, ]) > tidy_class_rpart = tidy(model_class_rpart) %>% + set_validation_data(iris[!train_index, ], "Species") > tidy_class_rpart ---- Rulelist -------------------------------- ▶ Keys: NULL ▶ Number of rules: 3 ▶ Model type: rpart ▶ Estimation type: classification ▶ Is validation data set: TRUE rule_nbr LHS RHS support confidence lift 1 1 ( Petal.Width < 1.7 ) & ( Petal.Lengt… vers… 28 0.967 2.53 2 2 ( Petal.Width < 1.7 ) & ( Petal.Lengt… seto… 21 0.957 3.46 3 3 ( Petal.Width >= 1.7 ) virg… 27 0.931 2.72 ----------------------------------------------> > model_regr_rpart = rpart::rpart(Sepal.Length ~ ., data = iris[train_index, ]) > tidy_regr_rpart = tidy(model_regr_rpart) %>% + set_validation_data(iris[!train_index, ], "Sepal.Length") > tidy_regr_rpart ---- Rulelist -------------------------------- ▶ Keys: NULL ▶ Number of rules: 5 ▶ Model type: rpart ▶ Estimation type: regression ▶ Is validation data set: TRUE rule_nbr LHS RHS support 1 1 ( Petal.Length >= 4.25 ) & ( Petal.Length < 5.85 ) & (… 6.15 23 2 2 ( Petal.Length < 4.25 ) & ( Petal.Length < 1.65 ) 4.99 17 3 3 ( Petal.Length < 4.25 ) & ( Petal.Length >= 1.65 ) 5.6 16 4 4 ( Petal.Length >= 4.25 ) & ( Petal.Length < 5.85 ) & (… 6.53 12 5 5 ( Petal.Length >= 4.25 ) & ( Petal.Length >= 5.85 ) 7.34 8 ----------------------------------------------> > # augment (classification case) > augment(tidy_class_rpart) %>% + tidytable::unnest(augmented_stats, names_sep = "__") %>% + tidytable::glimpse() Rows: 3 Columns: 9 $ rule_nbr 1, 2, 3 $ LHS "( Petal.Width < 1.7 ) & ( Petal.Length >=… $ RHS versicolor, setosa, virginica $ support 28, 21, 27 $ confidence 0.9666667, 0.9565217, 0.9310345 $ lift 2.533333, 3.461698, 2.721485 $ augmented_stats__support 24, 29, 21 $ augmented_stats__confidence 0.8333333, 1.0000000, 0.9523810 $ augmented_stats__lift 2.936508, 2.551724, 3.356009 > > # augment (regression case) > augment(tidy_regr_rpart) %>% + tidytable::unnest(augmented_stats, names_sep = "__") %>% + tidytable::glimpse() Rows: 5 Columns: 7 $ rule_nbr 1, 2, 3, 4, 5 $ LHS "( Petal.Length >= 4.25 ) & ( Petal.Length < … $ RHS 6.147826, 4.988235, 5.600000, 6.533333, 7.337… $ support 23, 17, 16, 12, 8 $ augmented_stats__support 20, 27, 13, 9, 5 $ augmented_stats__IQR 0.60, 0.45, 0.60, 0.50, 0.40 $ augmented_stats__RMSE 0.5085832, 0.3548713, 0.4497863, 0.3294215, 0… > > # party ---- > pen = palmerpenguins::penguins %>% + tidytable::drop_na(bill_length_mm) > set.seed(100) > train_index = sample(c(TRUE, FALSE), nrow(pen), replace = TRUE) > > model_class_party = partykit::ctree(species ~ ., data = pen[train_index, ]) > tidy_class_party = tidy(model_class_party) %>% + set_validation_data(pen[!train_index, ], "species") > tidy_class_party ---- Rulelist -------------------------------- ▶ Keys: NULL ▶ Number of rules: 5 ▶ Model type: constparty ▶ Estimation type: classification ▶ Is validation data set: TRUE rule_nbr LHS RHS support confidence lift terminal_node_id 1 1 ( flipper_length_mm … Gent… 50 1 3.02 8 2 2 ( flipper_length_mm … Adel… 73 0.986 2.08 3 3 3 ( flipper_length_mm … Chin… 17 0.941 4.86 5 4 4 ( flipper_length_mm … Chin… 7 0.714 3.69 9 5 5 ( flipper_length_mm … Chin… 13 0.692 3.57 6 ----------------------------------------------> > model_regr_party = + partykit::ctree(bill_length_mm ~ ., data = pen[train_index, ]) > tidy_regr_party = tidy(model_regr_party) %>% + set_validation_data(pen[!train_index, ], "bill_length_mm") Error in `[.data.table`(~.df, , `:=`(average = weighted.mean(response, : Internal error in assign: input dt has not been allocated enough column slots. l=3, tl=3, adding 1. Please report to the data.table issues tracker. Calls: %>% ... -> mutate.tidytable -> eval_tidy -> [ -> [.data.table Execution halted * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... Running ‘testthat.R’ [13s/13s] [13s/13s] ERROR Running the tests in ‘tests/testthat.R’ failed. Complete output: > library(testthat) > library(tidyrules) > > test_check("tidyrules") Saving _problems/test-party-19.R ---- Rulelist -------------------------------- ▶ Keys: trial_nbr ▶ Number of distinct keys: 1 ▶ Number of rules: 24 ▶ Model type: C5 ▶ Estimation type: classification ▶ Is validation data set: TRUE rule_nbr trial_nbr LHS RHS support confidence lift 1 1 1 ( JobLevel <= 1 ) & ( Mont… Yes 16 0.944 5.9 2 2 1 ( EnvironmentSatisfaction … No 521 0.941 1.1 3 3 1 ( DailyRate <= 722 ) & ( J… Yes 13 0.933 5.8 4 4 1 ( JobRole == 'Research_Sci… No 195 0.924 1.1 5 5 1 ( EnvironmentSatisfaction … Yes 9 0.909 5.6 6 6 1 ( EnvironmentSatisfaction … Yes 9 0.909 5.6 7 7 1 ( JobRole %in% c('Laborato… Yes 14 0.875 5.4 8 8 1 ( JobRole == 'Laboratory_T… Yes 6 0.875 5.4 9 9 1 ( Department == 'Sales' ) … Yes 13 0.867 5.4 10 10 1 ( TotalWorkingYears > 2 ) No 1347 0.864 1 # ℹ 14 more rows -------------------------------------------------- Rulelist -------------------------------- ▶ Keys: trial_nbr ▶ Number of distinct keys: 1 ▶ Number of rules: 24 ▶ Model type: C5 ▶ Estimation type: classification ▶ Is validation data set: FALSE rule_nbr trial_nbr LHS RHS support confidence lift 1 1 1 ( JobLevel <= 1 ) & ( Mont… Yes 16 0.944 5.9 2 2 1 ( EnvironmentSatisfaction … No 521 0.941 1.1 3 3 1 ( DailyRate <= 722 ) & ( J… Yes 13 0.933 5.8 4 4 1 ( JobRole == 'Research_Sci… No 195 0.924 1.1 5 5 1 ( EnvironmentSatisfaction … Yes 9 0.909 5.6 6 6 1 ( EnvironmentSatisfaction … Yes 9 0.909 5.6 7 7 1 ( JobRole %in% c('Laborato… Yes 14 0.875 5.4 8 8 1 ( JobRole == 'Laboratory_T… Yes 6 0.875 5.4 9 9 1 ( Department == 'Sales' ) … Yes 13 0.867 5.4 10 10 1 ( TotalWorkingYears > 2 ) No 1347 0.864 1 # ℹ 14 more rows ----------------------------------------------[ FAIL 1 | WARN 1 | SKIP 0 | PASS 76 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-party.R:19:1'): (code run outside of `test_that()`) ──────────── Error in ``[.data.table`(~.df, , `:=`(average = weighted.mean(response, weight, na.rm = TRUE)), by = "terminal_node_id", keyby = FALSE)`: Internal error in assign: input dt has not been allocated enough column slots. l=3, tl=3, adding 1. Please report to the data.table issues tracker. Backtrace: ▆ 1. ├─generics::tidy(model_party_re) at test-party.R:19:1 2. ├─tidyrules:::tidy.constparty(model_party_re) 3. │ └─... %>% ... 4. ├─tidytable::select(...) 5. ├─tidytable::mutate(., rule_nbr = 1:nrow(.)) 6. ├─tidytable::arrange(., RMSE, desc(support)) 7. ├─tidytable::left_join(., rules_df, by = "terminal_node_id") 8. │ ├─c(x, y, on, selection) %<-% ... 9. │ └─tidytable:::join_prep(x, y, by, keep, suffix, "left") 10. │ └─base::is.data.frame(x) 11. ├─tidytable::summarise(...) 12. ├─tidytable::mutate(...) 13. ├─tidytable:::mutate.tidytable(...) 14. │ └─rlang::eval_tidy(dt_expr, .df, dt_env) 15. ├─...[] 16. └─data.table:::`[.data.table`(...) [ FAIL 1 | WARN 1 | SKIP 0 | PASS 76 ] Error: ! Test failures. Execution halted * checking PDF version of manual ... OK * checking HTML version of manual ... OK * checking for detritus in the temp directory ... OK * DONE Status: 2 ERRORs See ‘/Users/ripley/R/packages/tests-devel/tidyrules.Rcheck/00check.log’ for details. 40.22 real 34.05 user 4.89 sys