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

> ### Name: create_byperson
> ### Title: Create a data set with one gain per person
> ### Aliases: create_byperson
> 
> ### ** Examples
> 
> # Create byperson data set, selecting the largest gain in case of muliple gains
> create_byperson(data = sgdata,
+                 sg_crit1_cutoff = 7,
+                 id_var_name = "id",
+                 tx_start_var_name = "bdi_s1",
+                 tx_end_var_name = "bdi_s12",
+                 sg_var_list = c("bdi_s1", "bdi_s2", "bdi_s3",
+                                 "bdi_s4", "bdi_s5", "bdi_s6",
+                                 "bdi_s7", "bdi_s8", "bdi_s9",
+                                 "bdi_s10", "bdi_s11", "bdi_s12"),
+                 sg_measure_name = "bdi",
+                 multiple_sg_select = "largest")
First, second, and third sudden gains criteria were applied.
The critical value for the third criterion was adjusted for missingness.
Error in `dplyr::mutate()`:
ℹ In argument: `sg_change_proportion =
  dplyr::na_if(sg_change_proportion, "-Inf")`.
Caused by error in `dplyr::na_if()`:
! Can't convert `y` <character> to match type of `x` <double>.
Backtrace:
     ▆
  1. ├─suddengains::create_byperson(...)
  2. │ └─suddengains::create_bysg(...)
  3. │   └─data_bysg %>% ...
  4. ├─dplyr::mutate(...)
  5. ├─dplyr:::mutate.data.frame(...)
  6. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by)
  7. │   ├─base::withCallingHandlers(...)
  8. │   └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns)
  9. │     └─mask$eval_all_mutate(quo)
 10. │       └─dplyr (local) eval()
 11. ├─dplyr::na_if(sg_change_proportion, "-Inf")
 12. │ └─vctrs::vec_cast(x = y, to = x, x_arg = "y", to_arg = "x")
 13. └─vctrs (local) `<fn>`()
 14.   └─vctrs::vec_default_cast(...)
 15.     ├─base::withRestarts(...)
 16.     │ └─base (local) withOneRestart(expr, restarts[[1L]])
 17.     │   └─base (local) doWithOneRestart(return(expr), restart)
 18.     └─vctrs::stop_incompatible_cast(...)
 19.       └─vctrs::stop_incompatible_type(...)
 20.         └─vctrs:::stop_incompatible(...)
 21.           └─vctrs:::stop_vctrs(...)
 22.             └─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = vctrs_error_call(call))
Execution halted