> > addmargins(UCBAdmissions, FUN = list(Total=sum))
> works with no problems, but consider:
> > myFUN <- list(Total=sum)
> > addmargins(UCBAdmissions, FUN = myFUN)
> Error in "names<-.default"(`*tmp*`, value = "") :
> names() applied to a non-vector
> Is this a bug?
I believe so. addmargins contains
FUN <- eval(add.names(substitute(FUN)))
and that only makes sense if FUN is a call and not a symbol. I've made
the appropriate change to R-devel.