Running ‘testthat.R’ [18s/24s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(stenR)
  This is version 0.6.9 of stenR package.
  Visit https://github.com/statismike/stenR to report an issue or contribute. If you like it - star it!
  > 
  > expect_plot_groups <- function(grouped_table, groups, strict = TRUE) {
  +   
  +   plot <- plot(grouped_table, group_names = groups, strict_names = strict)
  +   
  +   if (isTRUE(strict) && is.intersected(grouped_table)) {
  +     
  +     table_group <- names(grouped_table)
  +     table_group <- table_group[table_group %in% groups]
  +     
  +     plot_group <- unique(paste(plot$data$group1, plot$data$group2, sep = ":"))
  +     plot_group <- plot_group[plot_group %in% groups]
  +     
  +     expect_equal(table_group, as.character(plot_group))
  +     
  +   } else if (!isTRUE(strict) && is.intersected(grouped_table)) {
  +     
  +     table_names <- strsplit(names(grouped_table), split = ":")
  +     table_group1 <- unique(sapply(table_names, \(x) x[1]))
  +     table_group2 <- unique(sapply(table_names, \(x) x[2]))
  +     table_group1 <- table_group1[table_group1 %in% groups]
  +     table_group2 <- table_group2[table_group2 %in% groups]
  +     
  +     plot_group1 <- unique(plot$data$group1)
  +     plot_group1 <- plot_group1[plot_group1 %in% groups]
  +     plot_group2 <- unique(plot$data$group2)
  +     plot_group2 <- plot_group2[plot_group2 %in% groups]
  +     
  +     expect_equal(table_group1, as.character(plot_group1))
  +     expect_equal(table_group2, as.character(plot_group2))
  +     
  +     
  +   } else {
  +     
  +     table_group <- names(grouped_table)
  +     table_group <- table_group[table_group %in% groups]
  +     
  +     plot_group <- unique(plot$data$group1)
  +     plot_group <- plot_group[plot_group %in% groups]
  +     
  +     expect_equal(table_group, as.character(plot_group))
  +     
  +   }
  + }
  > 
  > test_check("stenR")
   name   M SD min max
   sten 5.5  2   1  10
   variable   n      range
      HEX_H 204 incomplete
      HEX_E 204 incomplete
      HEX_X 204 incomplete
      HEX_A 204 incomplete
      HEX_C 204   complete
      HEX_O 204 incomplete
  
   name   M SD min max
   sten 5.5  2   1  10
   variable   n      range
      HEX_H 204 incomplete
      HEX_E 204 incomplete
      HEX_X 204 incomplete
      HEX_A 204 incomplete
      HEX_C 204   complete
      HEX_O 204 incomplete
  
   name   M SD min max
   sten 5.5  2   1  10
   variable   n      range
      HEX_H 224 incomplete
      HEX_E 224 incomplete
      HEX_X 224 incomplete
      HEX_A 224 incomplete
      HEX_C 224   complete
      HEX_O 224 incomplete
  
   name   M SD min max
   sten 5.5  2   1  10
  Saving _problems/test-CompScoreTable-113.R
  Saving _problems/test-FrequencyTable-23.R
  Saving _problems/test-FrequencyTable-38.R
  Saving _problems/test-FrequencyTable-51.R
  No. groups: 3
  GroupConditions: 1
  1. Category: Sex
    * Tested vars: "sex"
    * No. groups:: 2
  .all groups included: TRUE
  No. groups: 12
  GroupConditions: 2
  1. Category: Sex
    * Tested vars: "sex"
    * No. groups:: 2
  2. Category: Age
    * Tested vars: "age"
    * No. groups:: 3
  .all groups included: TRUE
  No. groups: 3
  GroupConditions: 1
  1. Category: Sex
    * Tested vars: "sex"
    * No. groups:: 2
  .all groups included: TRUE
  Attached <StandardScale> object(s):
  * sten: `M`: 5.5; `SD`: 2; `min`: 1; `max`: 10
  No. groups: 12
  GroupConditions: 2
  1. Category: Sex
    * Tested vars: "sex"
    * No. groups:: 2
  2. Category: Age
    * Tested vars: "age"
    * No. groups:: 3
  .all groups included: TRUE
  Attached <StandardScale> object(s):
  * sten: `M`: 5.5; `SD`: 2; `min`: 1; `max`: 10
  computed on 204 observations
  Attached <StandardScale> object(s):
  * sten: `M`: 5.5; `SD`: 2; `min`: 1; `max`: 10
  min: 1; max: 5
  NA imputation method: "asis"
  NA literal value: NA
  1. item_1_reg
  2. item_2_reg_to_rev reversed
  3. item_3_na
  4. item_4_custom_na
  5. item_5_wider_rev
  Total items: 10
  Underlying objects:
  1. <ScaleSpec> reg_NA [No.items: 5]
  2. <ScaleSpec> custom_NA [No.items: 5]
  Underlying objects:
  1. reg_NA
    * Class: <ScaleSpec>
    * Items: "item_1_reg", "item_2_reg_to_rev", "item_3_na", "item_4_custom_na",
    and "item_5_wider_rev"
    * Reversed: "item_2_reg_to_rev"
  2. custom_NA
    * Class: <ScaleSpec>
    * Items: "item_1_reg", "item_2_reg_to_rev", "item_3_na", "item_4_custom_na",
    and "item_5_wider_rev"
    * Reversed: "item_2_reg_to_rev"
  [ FAIL 4 | WARN 5 | SKIP 0 | PASS 95 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-CompScoreTable.R:109:3'): No new data can be added when using simulated FreqTable ──
  <rlib_error_package_not_found/rlang_error/error/condition>
  Error in `SimFrequencyTable(min = 10, max = 50, M = 30, SD = 7)`: The package "SimMultiCorrData" is required.
  Backtrace:
      ▆
   1. ├─HEX_ST$attach_FrequencyTable(...) at test-CompScoreTable.R:109:3
   2. │ └─stenR::is.FrequencyTable(ft)
   3. └─stenR::SimFrequencyTable(min = 10, max = 50, M = 30, SD = 7)
   4.   └─rlang::check_installed("SimMultiCorrData")
  ── Error ('test-FrequencyTable.R:18:3'): FrequencyTable can be simulated ───────
  <rlib_error_package_not_found/rlang_error/error/condition>
  Error in `SimFrequencyTable(min = 10, max = 50, M = 30, SD = 7)`: The package "SimMultiCorrData" is required.
  Backtrace:
      ▆
   1. └─stenR::SimFrequencyTable(min = 10, max = 50, M = 30, SD = 7) at test-FrequencyTable.R:18:3
   2.   └─rlang::check_installed("SimMultiCorrData")
  ── Error ('test-FrequencyTable.R:36:3'): FrequencyTable plots ──────────────────
  Error in `plot.window(...)`: need finite 'xlim' values
  Backtrace:
      ▆
   1. ├─testthat::expect_s3_class(plot(ft_sim), c("gg", "ggplot")) at test-FrequencyTable.R:36:3
   2. │ └─testthat::quasi_label(enquo(object))
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. ├─base::plot(ft_sim)
   5. └─graphics::plot.default(ft_sim)
   6.   └─graphics (local) localWindow(xlim, ylim, log, asp, ...)
   7.     └─graphics::plot.window(...)
  ── Failure ('test-FrequencyTable.R:48:3'): FrequencyTable generates summary ────
  Expected `names(summary(ft_sim))` to equal `c(...)`.
  Differences:
      actual   | expected        
  [1] "Length" - "n"          [1]
  [2] "Class"  - "min"        [2]
  [3] "Mode"   - "max"        [3]
               - "mean"       [4]
               - "median"     [5]
               - "sd"         [6]
               - "skewness"   [7]
               - "kurtosis"   [8]
               - "incomplete" [9]
  
  
  [ FAIL 4 | WARN 5 | SKIP 0 | PASS 95 ]
  Error:
  ! Test failures.
  Execution halted