mice icon indicating copy to clipboard operation
mice copied to clipboard

mice doesn't handle complex variable names

Open Ralayax opened this issue 3 months ago • 0 comments

Describe the bug mice doesn't handle complex variable names (like variables with spaces or other strange characters)

To Reproduce

library(tidyverse)
library(mice)

mice::boys |>
  rename(`whooooo 151""1512` = tv) |>
  mutate(`this is a 'terrible varname....a` = 0) |> 
  mice::mice()

Expected behavior Should do multiple imputations

Additional context I will create a pull request adding backticks to variables inside the mice formulas to fix the issue

Ralayax avatar Mar 26 '24 15:03 Ralayax