Wordclouds from ORCiD

I keep seeing nice little wordclouds summarizing research profiles from different groups. I’ve played with them myself. Drawing is simple, but getting the data can be a pain. Now, with the new rorcid package that is made easy. If you don’t already have them, you need the following installed:

## install packages using the following
install.packages("devtools") # to install from github
library(devtools)
install_github("ropensci/rorcid") # to access orcid through R
install.packages(c("tm","wordcloud")) # to draw word clouds

I’ve put a few convenience functions in a gist, so do

Continue reading

Advertisements

Reading .xlsx files into R, quickly

The gdata library is fantastic for reading small .xls or .xlsx files into R, but it can be very slow for large files. Today I had to read data from the second sheet of a 64Mb .xlsx file. It should have gone something like

library(gdata)
my.data <- read.xls("myfile.xlsx", sheet=2, header=TRUE)

but R just hung there, unresponsive, for minutes.

Continue reading

Compiling a new kernel module to use hid-core for a Wacom Bamboo Pad

I previously built a custom kernel to use my Bamboo Pad under Ubuntu via the hid driver. This has proved to be a pain, as the kernel seems to be periodically updated by Ubuntu, which renders my system unstable.

So, now, after learning about building drivers from the wacom list (unfortunately I haven’t managed to get the Bamboo working with the wacom driver), I have tried just building a custom hid driver, as follows:

Continue reading

Ubuntu without a mouse

I’ve been getting potential RSI type pain in my hands. I’m taking steps to ergonomically improve my workspace, but I’m also attempting to stop using my mouse, as this seems part of the cause. My habit is to work on two screens, with the main screen arranged with an emacs window on the right, a terminal on the left (running R), and plots appearing on the other (rotated) screen, thus:

+------------+   +------------+-----------+
|            |   |            |           |
|            |   |            |           |    
|            |   |  (term)    |  (emacs)  |    
|  (plots)   |   |            |           |    
|            |   |            |           |     
|            |   |            |           |     
|            |   |------------|-----------|
|            |      
+------------+        

I typically type in emacs, highlight with mouse, then paste with middle click into the terminal. I’ve had this habit since at least 1997, so it is rather ingrained. It works well, because I can switch from writing R to ruby or perl and use the same muscle memory. This post is mostly about changing that habit.

Continue reading

Building a custom kernel to use hid-core for a Wacom Bamboo Pad

Wacom Bamboo Pad

I have a new Wacom Bamboo Pad. It is not recognised by the wacom drivers in Ubuntu 13.04. These are the wacom modules installed:

$ dpkg --list | grep -i wacom
ii  libwacom-common                           0.7-1                                                                  all          Wacom model feature query library (common files)
ii  libwacom2:amd64                           0.7-1                                                                  amd64        Wacom model feature query library
ii  xserver-xorg-input-wacom                  1:0.19.0-0ubuntu1                                                      amd64        X.Org X server -- Wacom input driver

This is what lsb-usb gives:

Continue reading