Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Second md.pattern() call does not render plot correctly #318

Closed
hanneoberman opened this issue Mar 15, 2021 · 3 comments
Closed

Second md.pattern() call does not render plot correctly #318

hanneoberman opened this issue Mar 15, 2021 · 3 comments

Comments

@hanneoberman
Copy link
Member

The plot of the missing data pattern is cropped, see reprex below.

library(mice)
#> Warning: package 'mice' was built under R version 4.0.4
#> 
#> Attaching package: 'mice'
#> The following object is masked from 'package:stats':
#> 
#>     filter
#> The following objects are masked from 'package:base':
#> 
#>     cbind, rbind
md.pattern(boys)
#>     age reg wgt hgt bmi hc gen phb  tv     
#> 223   1   1   1   1   1  1   1   1   1    0
#> 19    1   1   1   1   1  1   1   1   0    1
#> 1     1   1   1   1   1  1   1   0   1    1
#> 1     1   1   1   1   1  1   0   1   0    2
#> 437   1   1   1   1   1  1   0   0   0    3
#> 43    1   1   1   1   1  0   0   0   0    4
#> 16    1   1   1   0   0  1   0   0   0    5
#> 1     1   1   1   0   0  0   0   0   0    6
#> 1     1   1   0   1   0  1   0   0   0    5
#> 1     1   1   0   0   0  1   1   1   1    3
#> 1     1   1   0   0   0  0   1   1   1    4
#> 1     1   1   0   0   0  0   0   0   0    7
#> 3     1   0   1   1   1  1   0   0   0    4
#>       0   3   4  20  21 46 503 503 522 1622
md.pattern(boys)

#>     age reg wgt hgt bmi hc gen phb  tv     
#> 223   1   1   1   1   1  1   1   1   1    0
#> 19    1   1   1   1   1  1   1   1   0    1
#> 1     1   1   1   1   1  1   1   0   1    1
#> 1     1   1   1   1   1  1   0   1   0    2
#> 437   1   1   1   1   1  1   0   0   0    3
#> 43    1   1   1   1   1  0   0   0   0    4
#> 16    1   1   1   0   0  1   0   0   0    5
#> 1     1   1   1   0   0  0   0   0   0    6
#> 1     1   1   0   1   0  1   0   0   0    5
#> 1     1   1   0   0   0  1   1   1   1    3
#> 1     1   1   0   0   0  0   1   1   1    4
#> 1     1   1   0   0   0  0   0   0   0    7
#> 3     1   0   1   1   1  1   0   0   0    4
#>       0   3   4  20  21 46 503 503 522 1622

Created on 2021-03-15 by the reprex package (v1.0.0)

@stefvanbuuren
Copy link
Member

stefvanbuuren commented Mar 15, 2021

Hmm, that's curious. On RStudio 1.4.1032 on MacOS I get the full plot.

@stefvanbuuren
Copy link
Member

Ah, I now see what you mean.
It's the second invocation of the function. Perhaps md.pattern() changes par() and does not restore.

@gerkovink
Copy link
Member

I believe this is solved pending PR #323

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants