Thanks a lot for your detailed explanation I am overwhelmed.., I just would like to clarify one thing.. How the Function(x) gets resolve in an Anonymous function. means what argument generally pass ? does x resolves to dfx for the below code and if so then why cant we use x$age? you can give any other apply function example as well.. it is kind of my general doubt.
Sorry for my silly doubts may be..
ddply(dfx, .(group, sex), summarize,
mean = round(mean(age), 2),
sd = round(sd(age), 2),
mymin = function(x) {min(ifelse(is.na(x),0,x))})