Running examples in 'OmicFlow-Ex.R' failed
The error most likely occurred in:

> ### Name: diversity_plot
> ### Title: Diversity plot
> ### Aliases: diversity_plot
> 
> ### ** Examples
> 
> library("ggplot2")
>  
> n_row <- 1000
> n_col <- 100
> density <- 0.2
> num_entries <- n_row * n_col
> num_nonzero <- round(num_entries * density)
> 
> set.seed(123)
> positions <- sample(num_entries, num_nonzero, replace=FALSE)
> row_idx <- ((positions - 1) %% n_row) + 1
> col_idx <- ((positions - 1) %/% n_row) + 1
> 
> values <- runif(num_nonzero, min = 0, max = 1)
> sparse_mat <- Matrix::sparseMatrix(
+    i = row_idx,
+    j = col_idx,
+    x = values,
+    dims = c(n_row, n_col)
+  )
> 
> div <- OmicFlow::diversity(
+   x = sparse_mat,
+   metric = "shannon"
+ )
> 
> dt <- data.table::data.table(
+   "values" = div,
+   "treatment" = c(rep("healthy", n_col / 2), rep("tumor", n_col / 2))
+ )
> 
> colors <- OmicFlow::colormap(dt, "treatment")
Warning in RColorBrewer::brewer.pal(length(unique_groups), Brewer.palID) :
  minimal value for n is 3, returning requested palette with 3 different levels

> 
> diversity_plot(
+  data = dt,
+  values = "values",
+  col_name = "treatment",
+  palette = colors,
+  method = "shannon",
+  paired = FALSE,
+  p.adjust.method = "fdr"
+ )
$plot
Error in `gghalves::geom_half_point_panel()`:
! Problem while converting geom to grob.
ℹ Error occurred in the 2nd layer.
Caused by error in `fun()`:
! argument "layout" is missing, with no default
Backtrace:
     ▆
  1. ├─base (local) `<fn>`(x)
  2. ├─ggplot2 (local) `print.ggplot2::ggplot`(x)
  3. │ ├─ggplot2::ggplot_gtable(data)
  4. │ └─ggplot2 (local) `ggplot_gtable.ggplot2::ggplot_built`(data)
  5. │   └─ggplot2:::by_layer(...)
  6. │     ├─rlang::try_fetch(...)
  7. │     │ ├─base::tryCatch(...)
  8. │     │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
  9. │     │ │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 10. │     │ │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
 11. │     │ └─base::withCallingHandlers(...)
 12. │     └─ggplot2 (local) f(l = layers[[i]], d = data[[i]])
 13. │       └─l$draw_geom(d, layout)
 14. │         └─ggplot2 (local) draw_geom(..., self = self)
 15. │           └─self$geom$draw_layer(...)
 16. │             └─ggplot2 (local) draw_layer(..., self = self)
 17. │               └─base::lapply(...)
 18. │                 └─ggplot2 (local) FUN(X[[i]], ...)
 19. │                   ├─rlang::inject(self$draw_panel(data, panel_params, coord, !!!params))
 20. │                   └─self$draw_panel(...)
 21. │                     └─gghalves (local) draw_panel(...)
 22. │                       └─transformation$compute_layer(transformation_df, transformation_params)
 23. │                         └─ggplot2 (local) compute_layer(..., self = self)
 24. │                           └─ggplot2:::dapply(...)
 25. │                             └─base::lapply(...)
 26. │                               └─ggplot2 (local) FUN(X[[i]], ...)
 27. │                                 └─ggplot2 (local) apply_fun(cur_data)
 28. │                                   └─ggplot2 (local) fun(x, ...)
 29. └─rlang (local) `<fn>`(`<gtvrErrr>`)
 30.   └─handlers[[1L]](cnd)
 31.     └─cli::cli_abort(...)
 32.       └─rlang::abort(...)
Execution halted