Monthly Archives: January 2013

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 »

Standard Normal Variate (SNV: Other way)

January 1, 2013
By

This is another way to pre-treat aspectra set with the SNV math-treatment (Standard Normal Variate). You can see the other one in the post : "Standard Normal Variate (SNV)".In this post, I use the R function "sweep".library(ChemometricsWithR)#in a...

Read more »

Unicode in R packages (not)

January 1, 2013
By

Perhaps you are trying to add your nice new object as data for an R package. But wait. It has  foreign letters in its dimnames, so ’R CMD check’ will certainly complain. What you need is something to turn R’s natural Unicode-processing goodness into a relic from the early days of computing without inadvertently aliasing any words

Read more »