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

> ### Name: Test_Leaf
> ### Title: Test_Leaf The function is used to generate Leaf P-values for
> ###   case-control study. Users can input the leaf information through
> ###   argument struct_map. If there is not leaf information e.g.
> ###   struct_map=NULL, Test_Leaf will automatically construct leaf.
> ###   Argument thresh_val specifies the leaf size constructed from the
> ###   function. When the argument Gmat_case and Gmat_ctrl is null,
> ###   Test_Leaf will automatically generate those matrices.
> ### Aliases: Test_Leaf
> 
> ### ** Examples
> 
> data("snp_dat")
> 
> # Set leaf size M
> M <- 5
> 
> #Construct leaves and generate leaf p-value.
> p.leaf <- Test_Leaf(snp_dat=snp_dat,thresh_val=M)
Error in `mutate()`:
ℹ In argument: `num_unique = colsplit(num_comb, ",", c(1:2))[, 1]`.
Caused by error in `levels<-`:
! factor level [112] is duplicated
Backtrace:
     ▆
  1. ├─DYNATE::Test_Leaf(snp_dat = snp_dat, thresh_val = M)
  2. │ └─DYNATE:::construct_leafs(snp_dat = snp_dat, thresh_val = thresh_val)
  3. │   └─... %>% data.table()
  4. ├─data.table::data.table(.)
  5. ├─dplyr::mutate_at(., "Sample.Name", as.factor)
  6. │ └─dplyr:::manip_at(...)
  7. │   └─dplyr:::tbl_at_syms(...)
  8. │     └─dplyr:::tbl_at_vars(...)
  9. │       └─dplyr::tbl_vars(tbl)
 10. │         ├─dplyr:::new_sel_vars(tbl_vars_dispatch(x), group_vars(x))
 11. │         │ └─base::structure(...)
 12. │         └─dplyr:::tbl_vars_dispatch(x)
 13. ├─dplyr::select(...)
 14. ├─dplyr::mutate(., L1 = rleid(group2))
 15. ├─dplyr::ungroup(.)
 16. ├─dplyr::mutate(...)
 17. ├─dplyr::group_by(., domainID)
 18. ├─dplyr::mutate(., group = cumsum(c(-1L, diff(num_all)) <= 0L))
 19. ├─dplyr::mutate(...)
 20. ├─dplyr::mutate(...)
 21. ├─dplyr:::mutate.data.frame(., num_unique = colsplit(num_comb, ",", c(1:2))[, 1])
 22. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by)
 23. │   ├─base::withCallingHandlers(...)
 24. │   └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns)
 25. │     └─mask$eval_all_mutate(quo)
 26. │       └─dplyr (local) eval()
 27. ├─reshape2::colsplit(num_comb, ",", c(1:2))
 28. │ ├─base::data.frame(...)
 29. │ └─plyr::alply(vars, 2, type.convert, as.is = TRUE)
 30. │   └─plyr:::splitter_a(.data, .margins, .expand)
 31. │     └─base::lapply(dnames, function(x) factor(x, levels = x))
 32. │       └─plyr (local) FUN(X[[i]], ...)
 33. │         └─base::factor(x, levels = x)
 34. └─base::.handleSimpleError(...)
 35.   └─dplyr (local) h(simpleError(msg, call))
 36.     └─rlang::abort(message, class = error_class, parent = parent, call = error_call)
Execution halted