jackman.stanford.edu/blog
bannerImage

the spatial concentration of Green support

Monday September 13, 2010

Filed under: Australian Politics,R,statistics — jackman @ 10:18 am

I did some poking and prodding of the polling place data, looking at the way Green support is highly concentrated in the inner-capital cities (and in Melbourne and Sydney, in particular). There are a few interesting exceptions that will make sense to Australian readers: Nimbin, Kuranda, Broome…

A sample graph from the report:

Green support, distance from GPO

Comments (3)

mapping the Australian election (2010 edition)

Saturday September 11, 2010

Filed under: Australian Politics,R,statistics — jackman @ 4:23 pm

The AEC makes this reasonably easy, as do the authors of some very helpful R packages, the good people at Google Maps etc.

Full description here (PDF); entire collection here; a sample here, showing Green 1st preferences, by polling places across metropolitan Melbourne:

Melbournemetro Grn Primary

Comments (5)

San Bruno pipeline fire

Friday September 10, 2010

Filed under: general — jackman @ 2:58 pm

Terrifying scenes from the San Bruno fire last night. The burned out neighborhood up there reminds me of the 2009 Victorian fires and the 2003 Canberra fire.

I was also reminded that this is 2nd natural gas pipeline catastrophe I’ve been “close” too.

One evening in March 1994, while at Princeton, I was intrigued by an intense glow on the northern horizon. A bunch of us thought something was on fire somewhere, close. We decided to drive up and take a look. We stopped about 5 miles (!) north of Princeton, realizing that we were not getting much closer to the source; we crested a hill heading north on Route 1, and saw this intense orange fireball far to the north, lighting up the countryside for miles. The event has since come to be known as the Durham Woods fire.

Turns out that we were about 22 miles away from the fire in Princeton when we saw the glow of the fireball…:


View Larger Map

Comments Off

keep.source=TRUE and cacheSweave, R 2.12.0

Wednesday September 8, 2010

Filed under: general — jackman @ 4:12 pm

Sweave weirdness: does keep.source break in the presence of caching? With keep.source=TRUE I seem to get the entire Rnw file included in the Schunk, right up to the point of the code chunk.

For instance, consider Rnw like this:

\documentclass{article}
\usepackage{/Library/Frameworks/R.framework/Resources/share/texmf/tex/latex/Sweave}

\begin{document}
\thispagestyle{empty}

@ 
<<setCache,echo=FALSE,results=hide>>=
library(cacheSweave)
setCacheDir("./cache")
@ %def 

This is a test document.

@ 
<<rnorm,cache=TRUE,keep.source=TRUE>>=
z <- rnorm(n=1e3)
@ %def 

Summary:
@ 
<<summary>>=
summary(z)
@ %def 

The end.
\end{document}

I process the file with Sweave.sh (version 318) with the --cache option. The resulting tex is:

\documentclass{article}
\usepackage{/Library/Frameworks/R.framework/Resources/share/texmf/tex/latex/Sweave}

\begin{document}
\thispagestyle{empty}


This is a test document.

\begin{Schunk}
\begin{Sinput}
> \documentclass{article}
> \usepackage{/Library/Frameworks/R.framework/Resources/share/texmf/tex/latex/Sweave}
> 
> \begin{document}
> \thispagestyle{empty}
> 
> @ 
> <<setCache,echo=FALSE,results=hide>>=
> library(cacheSweave)
> setCacheDir("./cache")
> @ %def 
> 
> This is a test document.
> 
> @ 
> <>=
> z <- rnorm(n=1e3)
\end{Sinput}
\end{Schunk}

Summary:
\begin{Schunk}
\begin{Sinput}
> summary(z)
\end{Sinput}
\begin{Soutput}
    Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
-3.39800 -0.66320 -0.01361  0.01446  0.69020  3.19500 
\end{Soutput}
\end{Schunk}

The end.
\end{document}

with the Schunk for the rnorm code chunk looking back all the way to the top of the Rnw file.

I can verify that removing keep.source=TRUE makes the problem go away; similarly, disabling caching will also make the problem disappear.

Version info:

> version
               _                                                                
platform       x86_64-apple-darwin9.8.0                                         
arch           x86_64                                                           
os             darwin9.8.0                                                      
system         x86_64, darwin9.8.0                                              
status         Under development (unstable)                                     
major          2                                                                
minor          12.0                                                             
year           2010                                                             
month          08                                                               
day            30                                                               
svn rev        52842                                                            
language       R                                                                
version.string R version 2.12.0 Under development (unstable) (2010-08-30 r52842)

cacheSweave is at version 0.4-4.

Comments (1)

Powered by WordPress

Bad Behavior has blocked 2949 access attempts in the last 7 days.