saaply with custom function, ddply with colwise function