Created
August 22, 2014 18:44
-
-
Save vsbuffalo/a2c48027e177c7d25c89 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A quick function to save a PBM (http://en.wikipedia.org/wiki/Netpbm_format) | |
# visualize *a lot* of missing data pretty quickly (outside of R). | |
writeMissingPBM <- function(x, file) { | |
dims <- dim(x) | |
x[] <- as.integer(is.na(x)) | |
con <- file(file, open="wt") | |
writeLines(sprintf("P1\n%d %d", ncol(x), nrow(x)), con) | |
write.table(x, file=con, sep=" ", col.names=FALSE, row.names=FALSE, quote=FALSE) | |
close(con) | |
} | |
# use this to save a file, then run: | |
# cat yourfile.pbm | pnmtopng > yourfile.png | |
# you will likely need to zoom in on large files. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment