plot of chunk plot-ggplot

For a d3 bar plot visit

I finally compiled the data from all the pizza polling I’ve been doing at the New York R meetups. The data are available as json at

This is easy enough to plot in R using ggplot2.

pizzaJson <- fromJSON(file = "")
pizza <- ldply(pizzaJson,
##   polla_qid      Answer Votes pollq_id                Question
## 1         2   Excellent     0        2  How was Pizza Mercato?
## 2         2        Good     6        2  How was Pizza Mercato?
## 3         2     Average     4        2  How was Pizza Mercato?
## 4         2        Poor     1        2  How was Pizza Mercato?
## 5         2 Never Again     2        2  How was Pizza Mercato?
## 6         3   Excellent     1        3 How was Maffei's Pizza?
##            Place      Time TotalVotes Percent
## 1  Pizza Mercato 1.344e+09         13  0.0000
## 2  Pizza Mercato 1.344e+09         13  0.4615
## 3  Pizza Mercato 1.344e+09         13  0.3077
## 4  Pizza Mercato 1.344e+09         13  0.0769
## 5  Pizza Mercato 1.344e+09         13  0.1538
## 6 Maffei's Pizza 1.348e+09          7  0.1429
ggplot(pizza, aes(x = Place, y = Percent, group = Answer, color = Answer)) + 
    geom_line() + theme(axis.text.x = element_text(angle = 46, hjust = 1), legend.position = "bottom") + 
    labs(x = "Pizza Place", title = "Pizza Poll Results")

plot of chunk plot-ggplot

But given this is live data that will change as more polls are added I thought it best to use a plot that automatically updates and is interactive. So this gave me my first chance to need rCharts by Ramnath Vaidyanathan as seen at October’s meetup.

pizzaPlot <- nPlot(Percent ~ Place, data = pizza, type = "multiBarChart", group = "Answer")
pizzaPlot$xAxis(axisLabel = "Pizza Place", rotateLabels = -45)
pizzaPlot$yAxis(axisLabel = "Percent")
pizzaPlot$chart(reduceXTicks = FALSE)
pizzaPlot$print("chart1", include_assets = TRUE)

Unfortunately I cannot figure out how to insert this in WordPress so please see the chart at Or see the badly sized one below.

There are still a lot of things I am learning, including how to use a categorical x-axis natively on linecharts and inserting chart titles. I found a workaround for the categorical x-axis by using tickFormat but that is not pretty. I also would like to find a way to quickly switch between a line chart and a bar chart. Fitting more labels onto the x-axis or perhaps adding a scroll bar would be nice too.

How was Pizza 33?

  • Good (50%, 3 Votes)
  • Excellent (17%, 1 Votes)
  • Average (17%, 1 Votes)
  • Poor (17%, 1 Votes)
  • Never Again (0%, 0 Votes)

Total Voters: 6

Loading ... Loading …


Aggregated results.

Results from individual previous polls are below.

Continue reading

Wes McKinney and I are hosting our first ever Open Statistical Programming meetup tomorrow night after taking over for Drew Conway.  Please attend, have some pizza, enjoy the talk then come out for some beer.

This meetup is about EDA, Visualization and Collaboration on the Web and will be presented by Carlos Scheidegger from AT&T Labs.

This month’s pizza will be from Pizza Mercato in the Village.

Pi Day Celebrants

As mentioned earlier, yesterday was Pi Day so a bunch of statisticians and other such nerds celebrated at the new(ish) Artichoke Basille near the High Line.  We had three pies:  the signature Artichoke, the Margherita and the Anchovy, which was delicious but only some of us ate.  And of course we had our custom cake from Chrissie Cook.

The photos were taken by John.

Pi Cake 2011
NYC Data Mafia

NYC Data Mafia

Pi CakeHappy Pi Day everybody!  I’ll be out celebrating with the rest of the NYC Data Mafia eating pizza and devouring the above Pi Cake, custom baked by Chrissie Cook.

Today is also Albert Einstein’s birthday so there are plenty of reasons to have fun.

The cake below was my first ever Pi Cake in what is sure to become an annual tradition.

Pi Cake 2009

Update: Drew Conway does far more justice to our fair, irrational, transcendental number.

Update 2:  Engadget posted this awesome video of “What Pi Sounds Like.

Supreme Court Justice Antonin ScaliaDaily Intel caught wind of a California Lawyer interview with US Supreme Court Justice Antonin Scalia where he proclaims New York pizza “is infinitely better than Washington pizza, and infinitely better than Chicago pizza.”  I may be biased to New York pizza as well, but that is a debate I’ll save for another day.

It gets really interesting when he says, “You know these deep-dish pizzas—it’s not pizza. It’s very good, but … call it tomato pie or something.”  While an argument can certainly me made that deep-dish pizza is almost a casserole, I think the folks down in Trenton (where Scalia was born) have already claimed the name tomato pie, referring to a round pie with the sauce on top.

Hopefully Slice will chime in on this.

Last Wednesday I made a trip to Di Fara in Midwood, Brooklyn.  Since that place is well covered and lauded I won’t talk about the pizza, as amazing as it is. 

I gave Dom a copy of my thesis (pdf) on NYC pizza and he loved that his place was one of the few pizzerias mentioned by name (along with Lombardi’s and Otto Enoteca, two of my favorites) in the paper.  My friend captured these great photos and I’m extremely thankful to Dom for letting me in his kitchen. 

And to make the trip all the more surreal, Avenue J was lined with lulav and etrog vendors trying to clear out stock before Sukkot started.  The juxtaposition of Di Fara and the surrounding Orthodox neighborhood was striking and really shows the beauty of New York City. 

Gallery of photos below.

After years of waiting a new Artichoke Basilles our dreams have been answered.  The new spot, which hasn’t even been updated on the website yet, is at 17th and 10th opened this weekend.  Unlike the original location this one has seats and wait service and only sells pies, albeit smaller than the originals.  There is a side shop where they sell slices, but I didn’t venture in there.

The pie, seen below in the blurry iPhone shot, is just a smaller version of the pies at the original shop and were just as tasty.  One pie was too much food for a friend and me, so figure one pie ($17) for 2.5 to 3 people.

Additionally, they have a larger selection of pies and non-pizza food, such as salad and the sorts.  They don’t have beer or liquor yet, but should soon.

Updated (September 29th, 6:27 PM):  Slice Review.