Monthly Archives: January 2013

R code and data for book “R and Data Mining: Examples and Case Studies”

January 2, 2013
By
R code and data for book “R and Data Mining: Examples and Case Studies”

R code and data for book “R and Data Mining: Examples and Case Studies” are now available at http://www.rdatamining.com/books/rdm/code. An online PDF version of the book (the first 11  chapters only) can also be downloaded at http://www.rdatamining.com/docs. Below are its … Continue reading →

Read more »

NFL Code on Github

January 2, 2013
By
NFL Code on Github

I’ve made some revisions and simplifications to the code to compile NFL data. It’s now all out on Github for anyone to play with in advance of the Superbowl. In the meantime, here’s a lovely picture comparing every team’s offense- as measured by total offensive yards- against their defenders. Note the anemic Chicago offense. https://github.com/PirateGrunt/NFL

Read more »

Packages v. Libraries in R

January 2, 2013
By
Packages v. Libraries in R

In the past I've used the terms "R library" and "R package" synonymously (e.g. this blog post and this paper), but a careful reader has called me out. Mark Sharp notes that there are differences between libraries and packages. Chapter one of the R Manual Writing R Extensions gives the details: A package is a directory of files which I encourage you...

Read more »

Producing animated GIFs and Videos

January 2, 2013
By
Producing animated GIFs and Videos

It took me a while to figure out how to use the animation package on my Windows OS. In making an animated GIF, the problem seems to have been quite simple in the end (and I should have been more patient in reading the instructions!) - Following installation of the program ImageMagick, one has...

Read more »

Clone all your gists locally with R

January 2, 2013
By

I really like gists as a quick way to include more lengthly code snippets into my blog posts. However, I am not a git user as such, and so I was quite concerned when I noticed that all my gists on this blog had vanished after Christmas. I suppose this was a result of Github's downtime...

Read more »

Armadillo subsetting

January 2, 2013
By

A StackOverflow question asked how convert from arma::umat to arma::mat. The former is format used for find and other logical indexing. For the particular example at hand, a call to the conv_to converter provided the solution. We rewrite the answer he...

Read more »

Happy International Year of Statistics

January 2, 2013
By
Happy International Year of Statistics

2013 promises to be a great year for all statistics aficionado as today is the first day of the International Year of Statistics. More than 1400 organizations from 108 countries — professional

Read more »

Multiple Classification and Authorship of the Hebrew Bible

January 1, 2013
By
Multiple Classification and Authorship of the Hebrew Bible

Sitting in my synagogue this past Saturday, I started thinking about the authorship analysis that I did using function word counts from texts authored by Shakespeare, Austen, etc.  I started to wonder if I could do something similar with the … Continue reading →

Read more »

Efficiecy of Extracting Rows from A Data Frame in R

January 1, 2013
By
Efficiecy of Extracting Rows from A Data Frame in R

In the example below, 552 rows are extracted from a data frame with 10 million rows using six different methods. Results show a significant disparity between the least and the most efficient methods in terms of CPU time. Similar to the finding in my previous post, the method with data.table package is the most efficient

Read more »

Polarisation and Mobilisation indicators

January 1, 2013
By
Polarisation and Mobilisation indicators

This blog post makes available a set of indicators discussed in a forthcoming edition of Digital Icons. In brief, the script takes a text input and calculates polarisation and mobilisation indexes based on the number of pronouns featured.The hypothesised relationship between pronouns and polarisation is one discussed extensively by critical discourse analysts, social...

Read more »