Created
April 29, 2012 04:40
-
-
Save tmoertel/2533071 to your computer and use it in GitHub Desktop.
Small R script to visualize bit differences between two disk images
This file contains hidden or 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
library(ggplot2) | |
library(scales) | |
library(plyr) | |
library(reshape2) | |
disk_errors <- read.csv("disk_errors.csv", header=F) | |
names(disk_errors) <- c("byte_offset", "bit", "a", "b") | |
disk_errors <- mutate(disk_errors, | |
bit = factor(bit), | |
track = floor(byte_offset / 256 / 16), | |
track_byte = byte_offset - track * 256 * 16, | |
track_sector = track_byte / 256) | |
qplot(track, track_sector, data = disk_errors, color = bit, | |
shape = I("."), geom = "jitter", height = 0) + | |
scale_y_continuous(breaks = 0:16) + | |
opts(title = "Errors in round-trip image compared to original") + | |
xlab("Track in disk image") + | |
ylab("Logical position of byte error within track") | |
ggsave(file = "adtpro-round-trip-bit-errors.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment