m=as.data.frame(outer(1:5,6:9))

colnames(m)=c('a','b','c','d')

tf=function(df, col){list(mean(eval(substitute(col),df,parent.frame())),col
)}

tf(m,a) will issue error:  Error in tf(m, a) : object 'a' not found

How can I replace the col as char 'a' in the function?

Thank you

	[[alternative HTML version deleted]]

