Skip to content

! .x must be a vector, not a <formula> object. #45

@raffaem

Description

@raffaem

I'm trying to use mixedup::extract_het_var with a glmmTMB object like described in the tutorial, but I'm getting an error:

> mixedup::extract_het_var(mod_paper_1per, scale = 'var')
Error in `purrr::map()`:
! `.x` must be a vector, not a <formula> object.
Run `rlang::last_trace()` to see where the error occurred.
> rlang::last_trace(drop=FALSE)
<error/vctrs_error_scalar_type>
Error in `purrr::map()`:
! `.x` must be a vector, not a <formula> object.
---
Backtrace:
    ▆
 1. ├─mixedup::extract_het_var(mod_paper_1per, scale = "var")
 2. └─mixedup:::extract_het_var.glmmTMB(mod_paper_1per, scale = "var")
 3.   └─purrr::map(model$call$formula, function(x) grepl(x, pattern = "diag\\((.)*\\)"))
 4.     └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
 5.       └─vctrs::vec_assert(.x, arg = ".x", call = .purrr_error_call)
 6.         └─vctrs:::stop_scalar_type(x, arg, call = call)
 7.           └─vctrs:::stop_vctrs(...)
 8.             └─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = call)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions