Publications by Samuel Brown

Less than negative?

06.09.2010

An interesting thing that I found while doing the analysis for my previous post on the Canterbury earthquakes, was the difficulty of constraining figures less than a negative number. For example:ab3 & a<7] cd-7] > a[1] 1 2 3 4 5 6 7 8 9 10> b[1] 4 5 6> c[1] TRUE TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE> d[1] -1...

1017 sym

Canterbury Earthquakes part II

07.09.2010

Since posting last night, there’s been several more aftershocks, including several big ones. The total now stands (at 7:00pm) at 304 aftershocks, 70 greater than 4 on the Richter scale, 29 greater than 4.5, and 10 greater than 5. A couple of the fives happened last night, waking us up, and causing more damage to several buildings ar...

1368 sym 2 img

Canterbury Earthquakes part III

08.09.2010

As more people keep following the GeoNet website, they are starting to notice the seismic activity in areas other than Christchurch. A few people I’ve talked to have expressed concern that the Saturday 7-pointer has sparked earthquakes around the country. This is incorrect, as earthquakes below magnitude 3 are extremely common and a...

1957 sym 10 img

Changing phylogeny tip labels in R

14.01.2011

During the process of molecular systematic research, specimens are given code names and numbers to keep track of data through the pipeline. These can contain a lot of information of relevance to the researcher, but unfortunately are meaningless to others who aren’t as involved with the data. On publication, it is necessary to change...

1801 sym 2 img

Two R functions for working with DNA alignments

28.03.2011

Recently I wrote a couple of small functions as a result of work done by myself and others in my lab group. The first is a function that determines what sites in a sequence alignment are ambiguous (i.e. not A, G, C or T). require(ape)data(woodmouse)is.ambig    x    bases    ambig    ambig > 0}is.ambig(woodmouse)This functi...

1589 sym

Simplifying polygon shapefiles in R

19.04.2011

Recently I downloaded the Crosby Code shapefile from Landcare Research’s LRIS server for use in some publications I’m preparing. This shapefile is incredibly detailed, far more so than what I require. This detail means that it takes a while for the map to be plotted each time. As detail is less important for me than speed of plott...

4888 sym 2 img

Building R packages for Windows when you don’t use it.

02.05.2011

Are you a non-windows user wanting to share your R package with others who do use windows? There’s a handy utility (http://win-builder.r-project.org/)that allows you to upload your .tar.gz file and it checks it, builds it, and sends you a link to download a nice, shiny .zip file to give to your mates. Problem solved. Related To l...

736 sym

Alternately coloured line environment with fancyvrb

11.09.2011

Recently, while typing up an R tutorial, I used the LaTeX fancyvrb package to create two environments—one coloured blue for R commands, and one coloured red to display R output. This worked well for large blocks of each type. Then I decided I wanted to display a number of one-line commands and output alternately. Looking up the fanc...

1845 sym

Using Sweave with Beamer: A note on fonts

02.11.2011

Recently, I’ve been preparing a poster using the LaTeX packages Beamer and beamerposter. The poster discusses a bunch of R stuff that I’ve been doing lately, so I successfully used Sweave to incorporate R code into the poster. However, I had some trouble with package names that I wanted to typeset as small caps. The package names ...

2110 sym

spider: an R package for species identity and evolution

12.12.2011

spider: Species identity and evolution is an R package developed by the Lincoln University molecular ecology lab group to do a range of analyses that various lab members wanted to run that were not yet implemented in R. In particular, the package provides functions for conducting sliding window analyses on DNA sequences, the calculation of identi...

1601 sym 2 img