Skip to content

Visualize does not accept glmer() weights argument #137

@Senantq

Description

@Senantq

Hi Dustin.
Without flexplot I can't do real science.

Since this evening after updating some R packages, including flexplot and lme4, I'm encountering some issues with the visualize function. Here is a simple reprex:

rm(list = ls())
gc()
require(flexplot)
require(tidyverse)
require(lme4)

data(avengers)
avengers <- avengers %>%
    mutate(died_as_count = ifelse(died == "yes", 1, 0),
           died_as_ratio = died_as_count / injuries)

binom_full <- glmer(died_as_ratio ~ 1 + (1 | iq), family = binomial(), weights = injuries, data = avengers)
visualize(binom_full)

which outputs

Error in compare_fits_errors(data, outcome, predictors, testme) :
Sorry, but some variables in formula don't match what's in the model. Specifically, these variables are your in your formula, but not in the model:
weights

I expected the code to run without any problem, considering the weights as included in the model.
My actual version of lme4 is 1.1.35.5. My version of flexplot is the current one on the master branch.

Thanks a lot!

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