Welcome to my Open Notebook

This is an Open Notebook with Selected Content - Delayed. All content is licenced with CC-BY. Find out more Here.

ONS-SCD.png

show-missingness-in-large-dataframes-with-ggplot-thanks-to-r-blogger

Let’s try it out!

library(devtools)
# depends
install.packages("gbm")
install_github("tierneyn/neato")
library(neato)
# small eg
locs=c("Australia","India","New Zealand","Sri Lanka","Uruguay","Somalia")
f1=c(T,F,T,T,F,F)
f2=c(F,F,F,T,F,F)
f3=c(F,T,T,T,F,T)
atable=data.frame(locs,f1,f2,f3)
atable[atable == FALSE] <- NA
atable
png("ggplotmissing.png")
ggplot_missing(atable)
dev.off()

/images/ggplotmissing.png

  • The one I had problems with because too large is:
# Cool but what about a big one?
dat <- read.csv("~/path/to/file.csv")
str(dat)
png("ggplotmissing2.png", height=1800, width = 3000, res = 200)
ggplot_missing(dat)
dev.off()

/images/ggplotmissing2.png

Posted in  disentangle


blog comments powered by Disqus