<rdf:RDF
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xml:base='http://community.moertel.com/ss/rdf'>
    <s:Snip rdf:about='http://community.moertel.com/ss/rdf#comment-start/2004-11-02/1-1'
         s:name='comment-start/2004-11-02/1-1'
         s:cUser='tmoertel'
         s:oUser='tmoertel'
         s:mUser='tmoertel'>
        <s:content>In case you&apos;re curious, here&apos;s the shell script and {link:R|http://www.r-project.org/} code that I used to generate the above plot:&#xA;&#xA;{code:none}&#xA;\#!/bin/bash&#xA;&#xA;\# Generate all-states polling chart from electoral-vote.com data&#xA;\# Tom Moertel &lt;tom@moertel.com&gt;&#xA;\# 2004-11-02&#xA;&#xA;\# config&#xA;&#xA;CSV=allpolls.csv&#xA;FILEBASE=polls-by-state&#xA;GS=&quot;gs -dSAFTER -dBATCH -dNOPAUSE&quot;&#xA;&#xA;\# set up filenames&#xA;&#xA;EPS=$FILEBASE.eps&#xA;PNG=$FILEBASE.png&#xA;PDF=$FILEBASE.pdf&#xA;&#xA;\# get polling data and add header to it&#xA;&#xA;echo &quot;Making sure we have polling data (delete $CSV to force download) ...&quot;&#xA;&#xA;[ -f $CSV ] ||&#xA;(    echo -n date,series,state,ev,kerry,bush,nader,released,&#xA;     echo    unk2,unk3,unk4,unk5,unk6,unk7,unk8,source&#xA;     GET http\://www.electoral-vote.com/info/$CSV&#xA;) &gt; $CSV&#xA;&#xA;\# use R to generate plot in Postscript format&#xA;\# (uses X11 window so we can see the plot in passing)&#xA;&#xA;echo Generating plots ...&#xA;&#xA;R --no-save --no-init-file --no-restore-data  &lt;&lt;EOF&#xA;&#xA;    polls &lt;- read.csv(&quot;$CSV&quot;)&#xA;    require(&quot;lattice&quot;)&#xA;    trellis.device(x11, theme=col.whitebg())&#xA;    p &lt;- xyplot(kerry + bush ~ date | state, data=polls,&#xA;                main=&quot;Polling Numbers by State (Nov 2)&quot;,&#xA;                auto.key=list(rectangles=F,x=.75,y=.875,corner=c(1,1)),&#xA;                xlab=&quot;Elapsed days (1 = Sep 1)&quot;,&#xA;                ylab=&quot;Percentage who would vote for candidate&quot;)&#xA;    p&#xA;    dev.copy2eps(file=&quot;$EPS&quot;,family=&quot;Helvetica-Narrow&quot;)&#xA;&#xA;EOF&#xA;&#xA;\# create other graphics formats&#xA;&#xA;echo Rasterizing into PNG format ...&#xA;&#xA;$GS -sDEVICE=pngalpha -dBackgroundColor=&apos;16#ffeebb&apos; -dEPSCrop \\\&#xA;    -sOutputFile=$PNG $EPS&#xA;&#xA;echo Converting into PDF version ...&#xA;&#xA;ps2pdf -dEPSCrop $SIZEPARMS $EPS&#xA;&#xA;\# done!&#xA;&#xA;echo Done!&#xA;{code}&#xA;</s:content>
        <s:mTime>2004-11-03 12:54:53.6</s:mTime>
        <s:cTime>2004-11-03 12:53:51.554</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='#tmoertel'/>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#space/comment-start/2004-11-02/1-1'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
    </s:Snip>
</rdf:RDF>
