Learn R Programming

ggmice (version 0.1.1)

ggmice: Plot incomplete or imputed data

Description

Plot incomplete or imputed data

Usage

ggmice(data = NULL, mapping = ggplot2::aes())

Value

An object of class ggplot2::ggplot. The ggmice function returns output equivalent to ggplot2::ggplot output, with a few important exceptions:

  • The theme is set to theme_mice.

  • The color scale is set to the mice::mdc colors.

  • The colour aesthetic is set to .where, an internally defined variable which distinguishes observed data from missing data or imputed data (for incomplete and imputed data, respectively).

Arguments

data

An incomplete dataset (of class data.frame), or an object of class mice::mids.

mapping

A list of aesthetic mappings created with ggplot2::aes().

See Also

See the ggmice vignette to use the ggmice() function on incomplete data or imputed data.

Examples

Run this code
dat <- mice::nhanes
ggmice(dat, ggplot2::aes(x = age, y = bmi)) + ggplot2::geom_point()
imp <- mice::mice(dat, print = FALSE)
ggmice(imp, ggplot2::aes(x = age, y = bmi)) + ggplot2::geom_point()

Run the code above in your browser using DataLab