Vector assignment in R

As I use R for data analysis and simulations, I become more comfortable and proficient with the R/S syntax and style of programming. One important insight is the use of vector assignments in simulations. I have often read that using such assignments is the preferred method, but until recently I had not realised the importance of this statement. To illustrate the use of vector assignments and their advantages, consider two models of the style illustrated below:

Continue reading β†’

Image uploads

A particular challenge with maintaining a weblog is the uploading and resizing of images. The process involves choosing the correct images, creating large & thumbnail sized versions, uploading these images to the webserver, and posting the appropriate code into the weblog post. In the spirit of my last few posts, image2web is an applescript I use to automate this process: --user-specific variables property theAlbum : "Marked" --contains the images to be uploaded property theBasePath : "

Continue reading β†’

Podcasting & the CBC

The CBC has begun an experiment with podcasting. I’m impressed with the progressive approach to technology that the CBC has adopted and hope they expand the experiment to more of their programs. This has the added effect of making my Quirks & Quarks download script obsolete.

Continue reading β†’

Quirks & Quarks

Quirks & Quarks is the CBC’s excellent science program. I usually download the mp3 archives of the show on the weekends and listen while I walk Ceiligh. Of course, loading up the Quirks & Quarks webpage, finding the archives, downloading the mp3s, and adding them to iTunes takes at least a few minutes. Computers are much better and handling such tedium. Inspired by the success (for me) of the apod script, quirks.

Continue reading β†’

Astronomy pictures on the Desktop

The β€œAstronomy Picture of the Day” is a source of fantastic images. To take advantage of this resource, I went looking for a way to automatically set the current image as my Desktop background. A quick Google search turned up a perl script at www.haroldbakker.com. Although this was a great start, I wasn’t completely happy with the implementation of this script and decided to write my own. The apod.pl script is written in perl and both sets the Desktop background and copies a description of the image to the Desktop as an html file.

Continue reading β†’

Heritability of male-phase duration

These data measured the genetic architecture of male-phase duration in Chamerion angustifolium. There are three files in the archive used to estimate genetic variances & covariances with VCE. Format: protandryHeritabilityData.dat: Contains the measured data for male- & female-phase duration, flower size, & display size protandryHeritabilityPedigree.ped: Contains the pedigree information for the selection experiment protandryHeritabilityVCE: Is the VCE file that configures the analysis Citation: Routley, M.B. & B.C. Husband. 2004. Responses to selection on male-phase duration in Chamerion angustifolium.

Continue reading β†’

Climate change and public relations

A recent column in the Globe & Mail reminded me of our Federal Government’s plan for reducing greenhouse gas emissions: the One Tonne Challenge. This campaign challenges each Canadian to reduce their contribution to greenhouse gas emissions by one tonne. The first step is to calculate your emissions and then implement recommendations for reductions. According to the online calculator, Kelly & I combined emit 4.23 tonnes annually. Fortunately, this is below the national average of 5.

Continue reading β†’

Google Scholar

Yet another useful site from Google: Google Scholar. The site provides an interface for searching the scientific literature with typical Google ease. Some preliminary tests suggest that it is quite effective at finding relevant literature.

Continue reading β†’

JSTOR import script

I’ve written a script that imports a JSTOR citation page into BibDesk. To use the script, I suggest adding it to your script menu. Then, with the JSTOR citation page as the active web page in Safari, run the script and the citation will be added to the active BibDesk file. I use the first author’s last name and last two digits of the year as a cite key (e.g. Darwin59), you may want to change this to suit your style.

Continue reading β†’

The Crusade Against Evolution

An interesting read from Wired News – The Crusade Against Evolution. In addition, the Panda’s thumb has been following and carefully dissecting the recent controversy over an intelligent design paper being published in a peer-reviewed journal. The evolution-creation debate seems to be resurfacing after a short time off. The debate is important and the intelligent design supporters have to be countered, but their arguments have become hackneyed.

Continue reading β†’

Pollinator networks

Plants are sessile and, consequently, many species rely on pollinators for mating opportunities. However, pollinators do not necessarily visit every individual in a population with equal frequency. Plant attributes, such as floral display and reward provisioning, can influence the frequency of pollinator visitation. Furthermore, aspects of population density and structure may also influence visitation patterns. One effect of this unequal distribution of pollinator activity is that pollinators create networks of connections between plants in which a few plant receive many visits and many plants receive few visits.

Continue reading β†’

Dynamic State Variable Models in Ecology

There’s a powerful approach to modelling called dynamic state variable programming, covered in Dynamic State Variable Models In Ecology by Clark & Mangel. I’ll post more about the approach sometime, but for now I wanted to make an example from the book available. The first chapter of the book includes a guide through the creation of a patch foraging model. A fully implemented version is available in True BASIC, but I’ve decided to use R for all of my modelling and analyses.

Continue reading β†’

Journal abbreviations

Until recently, I was able to use journal abbreviations in all of my manuscripts. Consequently, my .bib file contains only abbreviations in the journal field. Now I need to produce some bibliographies with full journal names. With a .bib file you can use macros to handle changing abbreviated names to full names. However, BibDesk cannot use macros. Instead I wrote a perl script that searches through a .bib file and creates a new file with journal abbreviations changed to full names.

Continue reading β†’

Seed size

I have been investigating issues of ovule and seed development recently. One question that has come up is: How much variation is there in seed size? I had analysed some seed set data for some earlier work with some image analysis software. Consequently I have a large data set of seed area and perimeter for Chamerion angustifolium. A rough look at the data is: The data set is available as seedSizeData.

Continue reading β†’

Confronting models with data

The Ecological Detective by Ray Hilborn and Marc Mangel is an excellent source for learning how to analyse ecological data with sophistication. Traditionally, ecological data is analysed from the binary perspective of hypothesis testing. The goal of such testing is to either accept or reject a null hypothesis. Although it is well entrenched in ecological training and publication, this hypothesis testing has repeatedly been attacked by statisticians and many ecologists.

Continue reading β†’

Character assignments in phylogenetic analyses

In some recent research (http://public.me.com/mroutley/SIandDichogamy.pdf) I had to make inferences about families based on character states of the species within the family. One approach is to use a simple majority rule. For example, if more than half of the species possess character state x rather than y, then the family can be described as x. However, this approach seemed rather liberal, which led to a 2/3 majority criterion: if more than 2/3 of the species are x, the family is x; If less than 1/3 is x the family is y; otherwise the family is ambiguous.

Continue reading β†’

Reference management

I have been working through my references and papers trying to regain some control over the literature. Being reintroduced to the tedium of reference management, it seems like there must be a better way to catalogue and organize this important component of research. Ideally, with the Internet and some good citation support from publishers, I would never have to type a citation – just automagically download whatever I need. Obviously this is not currently available.

Continue reading β†’

Seed set of dichogamous plants

Description: These data are the average seed set estimates for dichogamous and adichogamous Chamerion angustifolium at different inflorescence sizes. Format: maternalID: Identification code for the maternal plant (i.e., grandmother of the counted seeds). individualID: Identification code of the plant. array#: The array identification number. dichogamyType: Indicates if the plant was dichogamous. flowerPosition: Flowers were sampled from either the bottom or top of the inflorescence. inflorescenceSize: The number of open flowers on each plant in the array.

Continue reading β†’