Monthly Archives: December 2012

Reading/Writing Stata (.dta) files with Foreign

December 4, 2012
By
Reading/Writing Stata (.dta) files with Foreign

Oftentimes we find ourselves collaborating with others who might not use R or prefer to use Stata to clean and manage their data. Luckily, there is the foreign package that permits handling data of different types (SAS, SPSS, Stata, etc.) within the R...

Read more »

Have you tried to understand your network? – Random generation of network models

December 4, 2012
By
Have you tried to understand your network? – Random generation of network models

I already talked about networks a few times in this blog. In particular, I had this approach to explain spatial segregation in a city or to solve the Guess Who? problem. However, one of the question is how to generate a good network. Indeed, I aim to study strategy to split a network, but I...

Read more »

What exactly is “elegant” code in R?

December 4, 2012
By

In celebration of my achieving 10,000 “reputation” on Stack Overflow, I’m re-posting one of my questions from there that was (as I had expected) deleted after being live for about 5 hours. In that time, I never really got a satisfactory answer, so if anyone wants to offer one in the comments, that would be

Read more »

Changing colours and legends in lattice plots

December 4, 2012
By
Changing colours and legends in lattice plots

Lattice plots are a great way of displaying multivariate data in R. Deepayan Sarkar, the author of lattice, has written a fantastic book about Multivariate Data Visualization with R . However, I often have to refer back to the help pages to remind myself how to set and change the legend and how to ensure that...

Read more »

project euler: problem 62

December 3, 2012
By

The cube, 41063625 (3453), can be permuted to produce two other cubes: 56623104 (3843) and 66430125 (4053). In fact, 41063625 is the smallest cube which has exactly three permutations of its digits which are also cube.Find the smallest cube for which exactly five permutations of its digits are cube. Read...

Read more »

Tutorial: How to make NYT-style bar charts with R

December 3, 2012
By
Tutorial: How to make NYT-style bar charts with R

New York Times columnist Charles Blow needed a chart to accompany his op-ed piece Lincoln, Liberty and Two Americas (about one-party control in state legislatures). So he turned to resident graphic editor Kevin Quealy, who found the source data and used R to create the chart below: If you'd like to create similar charts yourself, Kevin provides a useful...

Read more »

Using TeXmacs as an interface for R (part 1)

December 3, 2012
By
Using TeXmacs as an interface for R (part 1)

A nice, but not very well known, interface to R is TeXmacs. (I have to say that I am not totally objective, since I wrote the interface between R and TeXmacs…) Here’s a sample window: In the following few posts I’d like to explain how to use this interface. Installation First, install TeXmacs. Best is

Read more »

pbdR Updates – Distributed lm.fit() and More

December 3, 2012
By

Over the weekend, we updated all of the pbdR packages currently available on the CRAN.  The updates include tons of internal housecleaning as well as many new features. Notably, pbdBASE_0.1-1 and pbdDMAT_0.1-1 were released, which contain lm.fit() methods.  This function in particular has been available at my github for over a month, but didn't make its way to the...

Read more »

It’s Time For A Change: A Shiny One

December 3, 2012
By

I presented rApache to the public for the first time at the Directions in Statistical Computing workshop in August 2005 (paper), almost seven years ago. It might have been novel, maybe even crazy at the time, but I think rApache showed people a new way to bring R to the web. I presented brew, a templating framework for...

Read more »

To Transform or Not To Transform

December 3, 2012
By

Many of the forecasting packages in R requires a time series that is covariance stationary. For those who are not familiar with this term, there is an excellent online textbook by Hyndman and Athanasopoulos, Forecasting: Principles and Practice. Click ...

Read more »