Archive for March, 2010

Editra

| Gabriel |

I hadn’t been paying much attention to Editra since my last comparison shopping of text editors, but recently the project has made some really big strides and is shaping up to be a great cross-platform text editor. Most notably for me, it has both syntax highlighting and code-folding support for Stata. (In addition to R, perl, LaTex, bash, html, and plenty of languages I don’t use).  Furthermore, it now has a plug-in framework for language syntax so adding support for additional languages is easy if you have a Scintilla file. (The old method was to recompile from source — yes, really). There’s also a great “Generate” feature which will let you preserve your syntax highlighting in html, rtf, or tex, though in my experience the tex filter is buggy. (Note that there is a similar “copy as RTF” plug-in for TextMate). Finally, the Mac version comes as a binary and actually looks like a Quartz-native Mac program — no Fink / X11 hassle.

Editra is still considered an alpha release and I remain happy with TextMate for my own use, but if you need cross-platform and/or free, I’d recommend considering it. Note that these features could be especially valuable for teaching stats, since students have little money and use a variety of platforms.

Also, another free cross-platform editor worth checking out is Komodo. It has code-folding and syntax highlighting but as far as I can tell, the Stata syntax only supports highlighting (no folding) and there’s no R support at all, though it has a well-documented plug-in system so it should be feasible for someone to write or port an R syntax file to it.

March 3, 2010 at 4:54 am 2 comments

Network slideshow

| Gabriel |

Now that I’ve gotten R and igraph to make a set of 53 png files (see yesterday’s post), the next step is animating them. I did this using the command line tool ImageMagick, which I installed using Fink, the (buggy) Mac version of the Debian package manager. Once ImageMagick is installed, I can do everything from directly within R using system(). To accomplish this, I just added these lines of code to the end of yesterday’s script. The “mv” commands are necessary because ImageMagick has a naive view of alphabetical order.

#create animated gif in image magick
setwd("~/Documents/book/images/")
system("mv chrnet_hc0.png chrnet_hc00.png")
system("mv chrnet_hc1.png chrnet_hc01.png")
system("mv chrnet_hc2.png chrnet_hc02.png")
system("mv chrnet_hc3.png chrnet_hc03.png")
system("mv chrnet_hc4.png chrnet_hc04.png")
system("mv chrnet_hc5.png chrnet_hc05.png")
system("mv chrnet_hc6.png chrnet_hc06.png")
system("mv chrnet_hc7.png chrnet_hc07.png")
system("mv chrnet_hc8.png chrnet_hc08.png")
system("mv chrnet_hc9.png chrnet_hc09.png")
system("convert *.png chrnet_humps.gif")

Here are the results. Vertices are stations, which turn black when the station has begun playing “My Humps” by Black Eyed Peas. Yellow vertices have missing data on airplay (true missing data, not just right-censored). The graph layout is based on directed nominations from a survey so vertices near each other have low path length, but I hid the actual edges to preserve some privacy about the stations social network ties. My substantive interpretation of this animation (and a comparable event history) is that the network doesn’t really matter and the endogenous cascade is based on attention to aggregate peer behavior rather than that of specific alters.

Note that you may have to click on the image to see the animation.

March 1, 2010 at 1:35 pm 1 comment

Newer Posts


The Culture Geeks