njtierney / naniar

Tidy data structures, summaries, and visualisations for missing data
http://naniar.njtierney.com/
Other
651 stars 53 forks source link

naniar::gg_miss_upset printing extra empty plot in R markdown #286

Closed DeborahKapenda closed 2 years ago

DeborahKapenda commented 3 years ago

naniar::gg_miss_upset is producing an extra plot in markdown. How does one get rid of this? image

# reprex

library(naniar)

# create data 
data0 <- data.frame("A" = c(NA,NA,1,1), "B"= c(1,NA,1,1),"C"= c("john","john",NA,NA),"D"= c("john","john","john","john"))

# Naniar plot
nval <- naniar::n_case_miss(data0) 
naniar::gg_miss_upset(data0,nsets=nval)

I think the package is clashing with UpSetR::upset()

> packageVersion("naniar")[1]
[1] ‘0.6.1’

> packageVersion("rmarkdown")[1]
[1] ‘2.8’

# R version
> version
               _                           
platform       x86_64-w64-mingw32          
arch           x86_64                      
os             mingw32                     
system         x86_64, mingw32             
status                                     
major          4                           
minor          0.5                         
year           2021                        
month          03                          
day            31                          
svn rev        80133                       
language       R                           
version.string R version 4.0.5 (2021-03-31)
nickname       Shake and Throw             

> RStudio.Version()
$citation

To cite RStudio in publications use:

  RStudio Team (2021). RStudio: Integrated Development Environment for R.
  RStudio, PBC, Boston, MA URL http://www.rstudio.com/.

A BibTeX entry for LaTeX users is

  @Manual{,
    title = {RStudio: Integrated Development Environment for R},
    author = {{RStudio Team}},
    organization = {RStudio, PBC},
    address = {Boston, MA},
    year = {2021},
    url = {http://www.rstudio.com/},
  }

$mode
[1] "desktop"

$version
[1] ‘1.4.1106’

$release_name
[1] "Tiger Daylily"
njtierney commented 2 years ago

Hi there!

Unfortunately this is an issue with UpSetR, and not something I am able to fix on my end, my apologies!