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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: plot_model
> ### Title: Plot model fits
> ### Aliases: plot_model
> 
> ### ** Examples
> 
> 
> set.seed(1234567)
> 
> simulated_data <- simulate_data(nsubjects = 20)
Joining, by = "id"
> 
> model_output <- ushr(data = simulated_data)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
ushr
 --- call from context --- 
fit_model(data = data_filtered, id_vector = id_filtered, param_names = param_names, 
    initial_params = initial_params, free_param_index = free_param_index, 
    n_min_biphasic = n_min_biphasic, model_list = "four", whichcurve = get_biphasic, 
    forward_param_transform_fn = forward_param_transform_fn, 
    inv_param_transform_fn = inv_param_transform_fn, searchmethod = searchmethod)
 --- call from argument --- 
if (class(trySolve) == "try-error") {
    tmpCI <- NA
} else {
    tmpCI <- get_CI(fit)
}
 --- R stacktrace ---
where 1: fit_model(data = data_filtered, id_vector = id_filtered, param_names = param_names, 
    initial_params = initial_params, free_param_index = free_param_index, 
    n_min_biphasic = n_min_biphasic, model_list = "four", whichcurve = get_biphasic, 
    forward_param_transform_fn = forward_param_transform_fn, 
    inv_param_transform_fn = inv_param_transform_fn, searchmethod = searchmethod)
where 2: ushr(data = simulated_data)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (data, id_vector, param_names, initial_params, free_param_index, 
    n_min_biphasic, model_list, whichcurve = get_biphasic, forward_param_transform_fn, 
    inv_param_transform_fn, searchmethod) 
{
    fitlist <- vector("list", length = length(id_vector))
    CIlist <- vector("list", length = length(id_vector))
    model_fitlist <- vector("list", length = length(id_vector))
    nofitlist <- vector("list", length = length(id_vector))
    noCIlist <- vector("list", length = length(id_vector))
    for (i in 1:length(id_vector)) {
        datasubset = data %>% filter(id == id_vector[i])
        if ((nrow(datasubset) < n_min_biphasic) && (model_list == 
            "four")) {
            nofitlist[[i]] <- data.frame(index = i, id = id_vector[i], 
                reason = "not enough data")
            next
        }
        fitlist[[i]] <- data.frame(index = i, id = id_vector[i])
        fit <- get_optim_fit(initial_params, param_names, free_param_index, 
            data = datasubset, forward_param_transform_fn = forward_param_transform_fn, 
            inv_param_transform_fn = inv_param_transform_fn, 
            model_list = model_list, searchmethod = searchmethod)
        best_param <- get_params(fit, initial_params, free_param_index, 
            param_names, inv_param_transform_fn, index = i)
        if (det(fit$hessian) != 0 & all(!is.na(fit$hessian))) {
            trySolve <- try(solve(fit$hessian))
            if (class(trySolve) == "try-error") {
                tmpCI <- NA
            }
            else {
                tmpCI <- get_CI(fit)
            }
            if (any(is.na(tmpCI))) {
                noCIlist[[i]] <- data.frame(index = i, id = id_vector[i], 
                  reason = "could not obtain CIs")
            }
            else {
                CIlist[[i]] <- tmpCI %>% mutate(id = id_vector[i])
                model_fitlist[[i]] <- get_curve(data = datasubset, 
                  best_param, param_names = param_names[free_param_index], 
                  whichcurve = whichcurve)
            }
        }
        else {
            noCIlist[[i]] <- data.frame(index = i, id = id_vector[i], 
                reason = "could not obtain CIs")
        }
    }
    notfitted <- bind_rows(nofitlist) %>% rbind(bind_rows(noCIlist)) %>% 
        filter(!is.na(index)) %>% arrange(index)
    if (length(notfitted$id) > 0) {
        fitted <- bind_rows(fitlist) %>% filter(!id %in% notfitted$id)
    }
    else {
        fitted <- bind_rows(fitlist)
    }
    return(list(model_fitlist = model_fitlist, CIlist = CIlist, 
        fitted = fitted, notfitted = notfitted))
}
<bytecode: 0x564acfc100b0>
<environment: namespace:ushr>
 --- function search by body ---
Function fit_model in namespace ushr has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1