updated example using ddply... now loads plyr as required.
additional examples.