Running examples in ‘eHDPrep-Ex.R’ failed
The error most likely occurred in:

> ### Name: apply_quality_ctrl
> ### Title: Apply quality control measures to a dataset
> ### Aliases: apply_quality_ctrl
> 
> ### ** Examples
> 
> data(example_data)
> require(tibble)
Loading required package: tibble
> 
> # create an example class_tbl object
> # note that diabetes_type is classes as ordinal and is not modified as its
> # levels are not pre-coded
> tibble::tribble(~"var", ~"datatype",
+ "patient_id", "id",
+ "tumoursize", "numeric",
+ "t_stage", "ordinal_tstage",
+ "n_stage", "ordinal_nstage",
+ "diabetes", "factor",
+ "diabetes_type", "ordinal",
+ "hypertension", "factor",
+ "rural_urban", "factor",
+ "marital_status", "factor",
+ "SNP_a", "genotype",
+ "SNP_b", "genotype",
+ "free_text", "freetext") -> data_types
> 
> data_QC <- apply_quality_ctrl(example_data, patient_id, data_types, 
+    bin_cats =c("No" = "Yes", "rural" = "urban"),  min_freq = 0.6)
Error in `dplyr::summarise()`:
ℹ In argument: `dplyr::across(everything(), ~!.x %in% ord_levels)`.
Caused by error:
! `dplyr::across(everything(), ~!.x %in% ord_levels)` must be size 1,
  not 1000.
ℹ To return more or less than 1 row per group, use `reframe()`.
Backtrace:
     ▆
  1. ├─eHDPrep::apply_quality_ctrl(...)
  2. │ └─... %>% suppressWarnings()
  3. ├─base::suppressWarnings(.)
  4. │ └─base::withCallingHandlers(...)
  5. ├─eHDPrep::encode_cats(...)
  6. │ └─dplyr::select(data, !!!dplyr::enquos(...))
  7. ├─base::suppressMessages(.)
  8. │ └─base::withCallingHandlers(...)
  9. ├─eHDPrep::encode_genotypes(...)
 10. │ └─data %>% ...
 11. ├─dplyr::mutate(., dplyr::across(c(!!!vars), encode_genotype_vec))
 12. ├─eHDPrep::encode_ordinals(...)
 13. │ └─... %>% dplyr::filter(.data$value > 0)
 14. ├─dplyr::filter(., .data$value > 0)
 15. ├─tidyr::pivot_longer(., dplyr::everything())
 16. ├─dplyr::summarise(., dplyr::across(c(!!!vars), sum))
 17. ├─dplyr::summarise(., dplyr::across(everything(), ~!.x %in% ord_levels))
 18. ├─dplyr::select(., !!!vars)
 19. ├─eHDPrep::encode_ordinals(...)
 20. │ └─... %>% dplyr::filter(.data$value > 0)
 21. ├─dplyr::filter(., .data$value > 0)
 22. ├─tidyr::pivot_longer(., dplyr::everything())
 23. ├─dplyr::summarise(., dplyr::across(c(!!!vars), sum))
 24. ├─dplyr::summarise(., dplyr::across(everything(), ~!.x %in% ord_levels))
 25. ├─dplyr:::summarise.data.frame(., dplyr::across(everything(), ~!.x %in% ord_levels))
 26. │ └─dplyr:::summarise_cols(.data, dplyr_quosures(...), by, "summarise")
 27. │   └─base::withCallingHandlers(...)
 28. ├─dplyr:::dplyr_internal_error(...)
 29. │ └─rlang::abort(class = c(class, "dplyr:::internal_error"), dplyr_error_data = data)
 30. │   └─rlang:::signal_abort(cnd, .file)
 31. │     └─base::signalCondition(cnd)
 32. └─dplyr (local) `<fn>`(`<dpl:::__>`)
 33.   └─dplyr (local) handler(cnd)
 34.     └─rlang::abort(message, class = error_class, parent = parent, call = error_call)
Execution halted