Monthly Archives: May 2013

Using C libraries in R with rdyncall

May 12, 2013
By
Using C libraries in R with rdyncall

One reason I like using R for data analysis is that R has a great collection of packages that let you easily apply state-of-the-art methods to your problems. But once in a while you find a library that you would like to use that does not have a R wrapper, yet. While the great Rcpp

Read more »

A new package : Quandl

May 12, 2013
By
A new package : Quandl

Quandl is a new database management tool which seeks to become the place to find datasets. That is, each unique indicator is considered an independent data set. This helps them to seem to have a ginormous quantity of data sets. Source : Blog Econo...

Read more »

Reshaping data

May 12, 2013
By

Preparing and reshaping data is the ever continuing task of a data analyst. Luckily we have many tools for it. The default tool in R would be reshape(), although this is so user friendly that a reshape package has been added too. I try to use reshape()...

Read more »

Playing cards, with R

May 11, 2013
By
Playing cards, with R

In my courses on R, I usually show how to insert a picture as a background for a graph. But it is also to see the picture as an object, and to insert it in a graph everywhere we like to see it, as explained on the awesome blog http://rsnippets.blogspot.ca/…. (in a post published in January 2012). I wanted...

Read more »

Animations Understood

May 11, 2013
By
Animations Understood

When I first saw a graphic made from Yihui’s animation package (Xie, 2013) I was amazed at the magic and thought “I could never do that”. Passage of time… One night I found myself bored and as usual avoiding work. … Continue reading →

Read more »

Reproducibility and randomness

May 11, 2013
By
Reproducibility and randomness

With Stéphane Tufféry, we were working this week on a chapter of a book, entitled Statistical Learning in Actuarial Science. The chapter should be based on R functions, and we wanted to reproduce some outputs he previously obtained with SAS. The good thing is that even complex functions (logistic regression, regression trees, etc) produce the same kind of outputs....

Read more »

Veterinary Epidemiologic Research: Count and Rate Data – Poisson Regression and Risk Ratios

May 10, 2013
By
Veterinary Epidemiologic Research: Count and Rate Data – Poisson Regression and Risk Ratios

As noted on paragraph 18.4.1 of the book Veterinary Epidemiologic Research, logistic regression is widely used for binary data, with the estimates reported as odds ratios (OR). If it’s appropriate for case-control studies, risk ratios (RR) are preferred for cohort studies as RR provides estimates of probabilities directly. Moreover, it is often forgotten the assumption

Read more »

Spatial Critter Swarming Simulation

May 10, 2013
By
Spatial Critter Swarming Simulation

# I am interested in how small bits of individualized instructions can create collective action.# In this simulation I will give a single instruction to each individual in the swarm.# Choose another individual who is not too close, then accelerate towards that individual.# I also control momentum causing the previous movement and direction to...

Read more »

A guide to speeding up R code

May 10, 2013
By

Noam Ross recently shared a very useful guide to speeding up your R code. Get a bigger computer (for example, renting an instance on the Amazon cloud for a few cents an hour) Use parallel programming techniques Using the R byte-compiler Profiling and benchmarking your code Using high-performance packages (like xts, for time series) And lastly, rewriting your code...

Read more »

Tutorials on git/github and GNU make

May 10, 2013
By
Tutorials on git/github and GNU make

If you’re not using version control, you should be. Learn git. If you’re not on github, you should be. That’s real open source. To help some colleagues get started with git and github, I wrote a minimal tutorial. There are lots of git and github resources available, but I thought I’d give just the bare

Read more »