-2

How to display only the missing histogram and not the plot for combinations with VIM package?The below code displays both the plots- for missing as well as combination:-

output$miss <- renderPlot({
aggr(readDataForFreq(),col=mdc(1:2),prop =F,numbers =T,only.miss=T,plot=T,
          digits=15,
          labels = names(df), cex.axis = .9,cex.numbers=.5, oma = c(12,5,5,3),xlabs="Attributes",ylab=c("Histogram of Missing data", "Pink Missing-Blue Present"))})

Thanks,

ChinB
  • 105
  • 3
  • 10
  • please have a look at this https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and this https://stackoverflow.com/questions/48343080/how-to-convert-a-shiny-app-consisting-of-multiple-files-into-an-easily-shareable – MLavoie Aug 24 '18 at 20:33

1 Answers1

0

I could resolve this using ggplot:-

 data <- reactive({
      var.missing<- sapply(my_func(),function(x)sum(is.na(x)))
      var.missing<- var.missing[order(var.missing)]
      missing.df<- data.frame(variable=names(var.missing),missing=var.missing,missing.prop=var.missing/dim(myfunc())[1],stringsAsFactors=FALSE)     
    })


    output$miss <- renderPlot({

      ggplot(data=as.data.frame(data()),aes(x=(factor(variable,levels=variable,ordered=FALSE)),y=missing)) +
      geom_bar(stat = "identity",position="dodge") + labs(x="Variables",y="Number of Missing Values") + 
      theme(axis.text.x=element_text(angle=45, hjust=1))


      })
ChinB
  • 105
  • 3
  • 10