added information about installing R packages
[gmail-maildir-counter] / README
1 Scripts to Count Messages from Google
2 ==============================================================
3
4 Author: Benjamin Mako Hill (mako@atdot.cc)
5 License: GNU General Public License version 3 or any later version
6 Code: http://projects.mako.cc/source/?p=gmail-maildir-counter
7
8 I wrote this code in order to do the analysis I posted in this blog
9 post:
10
11 http://mako.cc/copyrighteous/google-has-most-of-my-email-because-it-has-all-of-yours
12
13 If you want to send me patches or bugfixes, details on how to do that
14 are here:
15
16 http://projects.mako.cc/source/
17
18 1. Parse your mailbox using the count_gmail.py script
19 --------------------------------------------------------------
20
21 I ran the script like this:
22
23 $ python count_gmail.py ~/incoming/mail/default > mail_metadata.tsv
24
25 2. Parse the output using analysis.R
26 --------------------------------------------------------------
27
28 If have not used R, you will to install R and three libraries I use in
29 the script. 
30
31 First, install R. In Debian and Ubuntu, the package is r-base. 
32
33 You will then need to install three R libraries. The easiest way to do
34 that is from within R. To start R, just invoke it from your shell:
35
36 $ R
37
38 Once R is running, you can install the packages by running these three
39 commands from within the R interactive shell:
40
41 > install.packages("data.table")
42 > install.packages("ggplot2")
43 > install.packages("reshape")
44
45 Once youv'e done that, you can run the scripts.  I run R interactively
46 in Emacs/ESS but you might want to use RStudio if you are not familiar
47 with Emacs. Alternatively, if you also output into mail_metadata.tsv,
48 you can just run:
49
50 $ R --no-save < analysis.R
51
52 It will create the two PDFs files of graphs for you in the local directory.
53
54 The I converted the PDFs into PNGs with imagemagick's mogrify:
55
56 $ mogrify -format png *pdf

Benjamin Mako Hill || Want to submit a patch?