.:. Megarhyssa .:.

A place for me to post pictures for family and friends, plug the odd interesting Web page, and discuss issues that are on my mind.

Monday, February 12, 2007

Octopus Joke

Not sure if this is an original one (it came to me in the shower this morning), but a Google search didn't come up with anything. Anyways, here goes:

Q - Why did the octopus linebacker win the Defensive Player of the Year award?

A - Because he had ten-tacles in every game!

OK, I won't quit my day job, but it's at least safe for a mixed crowd. :)

Thursday, February 08, 2007

Plotting degrees in R

Recently, I came across the problem of wanting to plot x values that were geographical coordinates (that is, I wanted to include degrees on the axis, or in the x axis label). After some puzzling over the issue (recall that I'm an R noob), I came across a query and answer on the R-help mailing list. Extremely useful as I found it, it lacked one element: the case in which you want to plot your own data, and only use the "at" part of the solution for creating labelled tick marks. Partially for my own benefit, I've added to the code suggested by Mark Schwartz, and I hope that somebody out there finds this helpful. Incidentally, this should be taken as an advertisement for R - scarcely a month after first picking up the package, I'm confident enough to edit and create code that produces publication-quality graphics.

# Create vector of x values for which you want degree labels
at <- seq(49, 54, 1)

# Create data to be plotted (normally, you will have data from
# columns in a spreadsheet)

x <- c(49, 50, 51, 52, 53, 53.8)
y <- c(1000, 1300, 1500, 1400, 1350, 1050)

# Create part of plot
plot(x, y, xlim = range(at), xaxt = "n", xlab = "Latitude", ylab = "Elevation (m a.s.l.)")

# Now create a set of plotmath expressions, one for
# each value of 'at' using paste() and parse()
# The general format for the degrees symbol is x*degree
# However, to add the "N" we use the "~" to create
# a right and left hand side for the expression and
# place the "N" after it. The "~" will not print.

L <- parse(text = paste(at, "*degree ~ N", sep = ""))

# Now do the x axis
axis(1, at = at, labels = L)

Friday, February 02, 2007

Open Source Fever

Well, after deciding that I was going to learn R for statistical analyses, I've been thinking quite a bit about other open source / freeware programs that I might switch to. One such application that I've started tinkering with is S5 - in the creator's own words, it's 'a slide show format based entirely on XHTML, CSS, and JavaScript.' Put bluntly, a clever cross platform alternative to Microsoft's bloated presentation software. No more worrying about what OS the conference computer is running - just fire up a web browser (preferably not IE) and off you go! It's a bit daunting to contemplate converting my existing lectures to this format, but I'm very seriously considering using it for new lectures.

I've also flirted with the idea of using LyX for document processing, again in favour of an well known (and equally bloated) MS application. Not sure if I'll go through with that or not -- in addition to not being sure how I'll deal with the inevitable .doc files that will clutter my Inbox, I was put off by the plethora of other helper programs that need to be installed first. Let's say that installing and using LyX is on the backburner for now.

Finally, I wrote this entry with the free text editor Smultron.