## R function to convert degrees to radians

December 23, 2010
By

I would have never imagined that I would have to go back to high school concepts and do strange trigonometric calculations. However, it happened to me that I needed to convert GPS coordinates of a large data set to radians. It’s a trivial task, if you know how to do it. The function takes as

## Project Euler — Problem 187

December 23, 2010
By

http://projecteuler.net/index.php?section=problems&id=187 A composite is a number containing at least two prime factors. For example, 15 = 3 × 5; 9 = 3 × 3; 12 = 2 × 2 × 3. There are ten composites below thirty containing precisely two, not necessarily distinct, prime factors: 4, 6, 9, 10, 14, 15, 21, 22, 25, 26. Read...

## Project Euler — Problem 187

December 23, 2010
By

http://projecteuler.net/index.php?section=problems&id=187 A composite is a number containing at least two prime factors. For example, 15 = 3 × 5; 9 = 3 × 3; 12 = 2 × 2 × 3. There are ten composites below thirty containing precisely two, not necessarily distinct, prime factors: 4, 6, 9, 10, 14, 15, 21, 22, 25, 26. Read...

## Some problems with the Mexican mortality database

December 22, 2010
By

I've written before about how I couldn't find the Acteal Massacre in the homicide database available at the INEGI. So I decided to check if the deaths that occurred as a consequence of the massacre were misclassified as other types of violent death, and indeed they were. In the municipality of Chenalhó,...

## Some problems with the Mexican mortality database

December 22, 2010
By

I've written before about how I couldn't find the Acteal Massacre in the homicide database available at the INEGI. So I decided to check if the deaths that occurred as a consequence of the massacre were misclassified as other types of violent death, and indeed they were. In the municipality of Chenalhó,...

## A plea for consistent style!

December 22, 2010
By

As we get close to the end of the year, it's time to look back over the past year and think of resolutions for 2011 and beyond. One that's often on my mind relates to ways to structure my code to make it clearer to others (as well as to myself when I l...

## Forbes: R is a name you need to know in 2011

December 22, 2010
By

The December 20 issue of Forbes magazine, on newsstands now, includes a column about R on page 128 as part of the "Name You Need to Know in 2011" feature. It's basically an excerpt from this blog post by Steve McNally and its comments, and includes quotes from Norman Nie of Revolution Analytics, Bill Alpert of Barron's, and Brandon...

## A Special Graphics Device in R: the Null Device

December 22, 2010
By

It is well-known that R has several graphics devices — either the screen devices (X11(), windows(), …) or the off-screen devices (pdf(), png(), …). We can query the default graphics device in options(): getOption('device') In a non-interactive session, the default device is pdf(). This is why Sweave has to create a file named Rplots.pdf no

## Oil – Natural Gas Cointegration – turning point?

December 22, 2010
By

## Data-driven arterial input functions

December 22, 2010
By

I haven't devoted any time/effort/code to the extraction and parameter estimation of arterial input functions (AIFs) for DCE-MRI in either the vignette or the submission to JSS.  Frankly, I wanted to communicate the main features of the R package dcemriS4 and data-driven AIFs just haven't made the list... up 'til now.  So let's assume one wants to fit...

## Data-driven arterial input functions

December 22, 2010
By

I haven't devoted any time/effort/code to the extraction and parameter estimation of arterial input functions (AIFs) for DCE-MRI in either the vignette or the submission to JSS.  Frankly, I wanted to communicate the main features of the R package dcemriS4 and data-driven AIFs just haven't made the list... up 'til now.  So let's assume one wants to fit...

## Stacked histogram with ggplot2

December 22, 2010
By

With ggplot2 there is a possibility to create divide bars of a histogram into different categories:

## RcppExamples 0.1.2

December 22, 2010
By

A new version of our RcppExamples, package is now on CRAN. RcppExamples contains a few illustrations of how to use Rcpp. It grew out of documentation for the classic API (now in its own package RcppClassic) and we added more functions documenting...

## A Special Graphics Device in R: the Null Device

December 22, 2010
By

It is well-known that R has several graphics devices -- either the screen devices (X11(), windows(), ...) or the off-screen devices (pdf(), png(), ...). We can query the default graphics device in options(): getOption('device') In a non-in...

## CrossValidated Journal Club

December 21, 2010
By

Journal Clubs are a great way to learn new research ideas and to keep up with the literature. The idea is that a group of people get together every week or so to discuss a paper of joint interest. This can happen within your own research group or department, or virtually online. There is now

## Questions on the parallel Rao-Blackwellisation

December 21, 2010
By
$Questions on the parallel Rao-Blackwellisation$

Pierre Jacob and I got this email from a student about our parallel Rao-Blackwellisation paper. Here are some parts of the questions and our answer: Although I understand how the strategy proposed in the paper helps in variance reduction, I do not understand why you set b=1 (mentioned in Section 3.2) and why it plays

## How Orbitz uses Hadoop and R to optimize hotel search

December 21, 2010
By

Positional bias — the tendency for users to preferentially select results in the first few positions of a search — is a big issue for all kinds of search engines. But for online travel site Orbitz the stakes are higher than for a traditional Web search engine: if a customer chooses the first-listed hotel in a search for accommodations,...

## My favorite R packages (installed with one command)

December 21, 2010
By

I just started a new job (working on social search awesomeness at Bing) and so I had to set up my “dev” environment with all of my usual tools (R, python,vim,etc). One thing that made this a bit easier is my habit of keeping an R script around that installs all of my common packages

## NppToR 2.5.2 Improves startup

December 21, 2010
By

I’ve been getting lots of feedback that there are problems starting NppToR with some of the latest version. I took to the task of looking at that yesterday on the train home. I have made improvements to the way NppToR finds the RHome directory, not relying entirely on the windows registry. I also removed the

## R programming books

December 21, 2010
By

My sabbatical is rapidly coming to an end, and I have to start thinking more and more about teaching. Glancing over my module description for the introductory computational statistics course I teach, I noticed that it’s a bit light on recommend/background reading. In fact it has only two books: A first course in statistical programming

## A Very Data Christmas

December 21, 2010
By

This week Google announced its Ngram Viewer, which allows you to explore the use of words in thousands of texts overtime, going back two hundred years. Given the relatively long time period covered by this massive data set, it is fun to explore how language has changed overtime. Some texts, however, seem to transcend time.

## oro.nifti 0.2.4

December 21, 2010
By

The R package oro.nifti contains functions for the input/output and visualization of medical imaging data that follow either the ANALYZE, NIfTI or AFNI formats.  This package is part of the Rigorous Analytics bundle.Orthographic display of stru...

## oro.nifti 0.2.4

December 21, 2010
By

The R package oro.nifti contains functions for the input/output and visualization of medical imaging data that follow either the ANALYZE, NIfTI or AFNI formats.  This package is part of the Rigorous Analytics bundle.Orthographic display of stru...

## Back from Philly

December 20, 2010
By

The conference in honour of Larry Brown was quite exciting, with lots of old friends gathered in Philadelphia and lots of great talks either recollecting major works of Larry and coauthors or presenting fairly interesting new works. Unsurprisingly, a large chunk of the talks was about admissibility and minimaxity, with John Hartigan starting the day

## Michael Kane on Bigmemory

December 20, 2010
By

Handling big data sets has always been a concern for R users. Once the size of the data set reaches above 50% of RAM, it is considered “massive” and can literally become impossible to work with on a standard machine. The bigmemory project, by Michael Kane and Jay Emerson, is one approach to dealing with

## Rcpp 0.9.0 and RcppClassic 0.9.0

December 20, 2010
By

A new release 0.9.0 of Rcpp is now available at CRAN and has just been uploaded to Debian. As always, sources are also available from my local directory here. With this release, the older API which we have been referring to as the classic Rcpp A...

## MATLAB / R Reference

December 20, 2010
By

nStrict Standards: Non-static method StringParser_Node::destroyNode() should not be called statically, assuming \$this from incompatible context in /afs/ir.stanford.edu/users/k/n/knoepfle/cgi-bin/flatpress/fp-plugins/bbcode/inc/stringparser.class.php o...

## MATLAB / R Reference

December 20, 2010
By

Anyone with a MATLAB background interested in transitioning to R is advised to check out this MATLAB / R Reference by Professor David Hiebeler of the University of Maine.