Thank you (all) for the helpful explanations! My own R code tends to simpler constructs, but now perhaps we can start having obfuscated code competitions: something common in Perl, but I have not seen in R (yet). Anyone up for the challenge? Best wishes, Mark -- Dr. Mark Wardle Specialist registrar, Neurology Cardiff, UK