Last active
November 28, 2016 11:42
-
-
Save wookietreiber/2776916a755ffd910ff0ac7bb1c38983 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
#!/usr/bin/env r | |
# create input file with: | |
# $ find /path/to/dir -type f -printf '%s\n' | gzip > dir.file.sizes.gz | |
# start with: | |
# $ zcat dir.file.size.gz | fshist.r | |
# edit breaks to your needed sizes | |
# leave the breaks "0" and "2^50" for the edges | |
suppressMessages(library(stats)) | |
suppressMessages(library(utils)) | |
suppressMessages(library(gdata)) | |
sizes <- scan("stdin", quiet = T) | |
h <- hist(sizes, plot = F, breaks = c(0, 1, 3584, 2^15, 2^18, 2^20, 2^24, 2^30, 2^37, 2^50)) | |
d <- data.frame ( | |
min = humanReadable(head(h$breaks, -1)), | |
max = humanReadable(tail(h$breaks, -1)), | |
count = h$counts | |
) | |
print(d) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment