ggmice
ggmice copied to clipboard
Incomplete data are not displayed with `ggmice()` if log transformation is applied within the mapping
One solution is to apply the transformation beforehand. Maybe just add a message whenever a log transformation is applied on an incomplete variable within the aes() function? Or actually solve the issue?
There are some solutions: using the I()
function, transforming the data, or using one of the scale_*()
functions.
There 2 options:
- data -> transform with mutate -> ggmice
- data -> ggmice -> scale_*_log
library(ggmice)
ggmice(mice::nhanes, ggplot2::aes(x = age, y = log(bmi))) + ggplot2::geom_point()
#> Warning in log(bmi): NaNs produced
#> Warning in log(bmi): NaNs produced
#> Warning: Removed 9 rows containing missing values (`geom_point()`).
Created on 2023-01-19 with reprex v2.0.2
@pepijnvink please write a message if log(
is included in one of the mapping variables
Fixed in #80