Thanks everyone. The mutate function worked great: all2<- mutate(all1,upper=p75+1.5*(p75-p25),lower=p25-1.5*(p75-p25)) -- View this message in context: http://r.789695.n4.nabble.com/Using-PLYR-to-apply-a-custom-function-to-a-data-frame-tp4663897p4663902.html Sent from the R help mailing list archive at Nabble.com.