# Monthly Archives: October 2012

## Multiple levelplots with title and subtitle in R

October 23, 2012
By

I had quite a fight with R to put multiple levelplots with a shared title and subtite on the same chart, so I thought I put a PoC code here: library(lattice)m col.l plot.new()par(mfrow=c(2,2), oma=c(2,0,2,0))print(levelplot(m, col.regions=col.l, main="L1"), split=c(1, 1, 2, 2)) print(levelplot(m, col.regions=col.l, main="L2"), split=c(1, 2, 2, 2), newpage=FALSE)print(levelplot(m, col.regions=col.l, main="L3"), split=c(2, 1, 2, 2), newpage=FALSE)print(levelplot(m, col.regions=col.l, main="L4"), split=c(2,...

## Bayes for President!

October 23, 2012
By

I couldn't resist getting sucked into the hype associated with the US election and debates, and so I thought I had a little fun of my own and played around a bit with the numbers. [OK: you may disagree with the definition of "fun" \$-\$ but then again, i...

## analyze the general social survey (gss) with r

October 23, 2012
By

the general social survey (gss) has served as america's mood ring since 1972.  data-driven social scientists can compare political beliefs by demography, look at attitude trends, make emile durkheim and max weber (pronounced durk-veber) proud.&nbs...

## Benchmarking matrix creation

October 23, 2012
By

Sometimes it is useful to take a vector, or one column/row of a matrix, and build a new matrix of identical copies of that vector. There are lots of different ways to do this, but I just discovered a new, and very straightforward way to do this with m...

## The basics of Value at Risk and Expected Shortfall

October 23, 2012
By

Value at Risk and Expected Shortfall are common risk measures.  Here is a quick explanation. Ingredients The first two ingredients are each a number: The time horizon — how many days do we look ahead? The probability level — how far in the tail are we looking? Ingredient number 3 is a prediction distribution of … Continue reading...

## Presidential Debates 2012

October 23, 2012
By

I have been playing with the beta version of qdap utilizing the presidential debates as a data set. qdap is in a beta phase lacking documentation though I’m getting there. In previous blog posts (presidential debate 1 LINK and VP … Continue reading →

## It Takes 2 Lines of R Code to Discover Interesting Biology

October 23, 2012
By

The following biological phenomenon demonstrates just how elegant R code can be. In vertebrate genomes, a methyl group (-CH3) can be added to nucleotides. Such process of methylation is commonly associated with gene suppression. Most of the cytosines in the … Continue reading →

## googleVis 0.3.0/0.3.1 is released: It’s faster!

October 23, 2012
By

Version 0.3.0 of the googleVis package for R has been released on CRAN on 20 October 2012. With this version we have been able to speed up the code considerably. The transformation of R data frames into JSON works significantly faster. The execution of the gvisMotionChart function in the World Bank demo is over 35 times...

## ChIP-seq Analysis with Bioconductor

October 22, 2012
By

Often scientists are interested in finding genome-wide binding site of their protein of interest. R offers easy way to load and process the sequence files coming from ChIP-seq experiment. During the next weeks I’m going to present a pipeline that … Continue reading →

## Top Facebook Posts During the US Presidential Debate

October 22, 2012
By

The following data was collected during the Presidential Debate on the 22nd of October by tapping into the Facebook social graph API using R. The top three posted links during the debate for each candidate are: Obama- #1     http://bit.ly/QCODJg #2     http://bit.ly/RXstnm #3    http://bit.ly/P8MmJ1 Romney- #1    http://bit.ly/zDdsKf #2    http://bit.ly/SjFbKx