Monthly Archives: June 2012

Cross tables in R, some ways to do it faster

In R to create a contingency table of the counts of the combination of two variables, I would normally resort to table(). But how fast is it? A question that becomes more relevant when working on large tables and when you have to run it very often. As you will see in the examples below, it isn’t terribly fast and there are other ways to create cross tables faster. Continue reading

From attribute table to QGIS style file – step 1

I have a large number of GRASS vector layers with in the attribute table a RGB column defining the colours of the corresponding mapping units. Unfortunately, unlike GRASS, QGIS does not offer the option to to set colours from an RGB column. The feature has been requested before, but it isn’t implemented (yet).

Edit: Since writing of this post, the feature has been implemented; see this post and this post on gis.stackexchange.com

As an alternative, I want to create a R script that takes the RGB values from the attribute tables and uses this to create a QGIS style file (qml file). Continue reading