Skip to content
Prev 157447 / 398506 Next

using tapply on a data frame in a function

eric lee wrote:
This is neither caused by tapply, data frames, nor functions....

You are trying to use a character string ('value1') as if it were a 
variable name. It wouldn't work either to say tapply('value1', cluster, 
mean) would it?

You might be looking for tapply(framename[[index]],....), or 
with(framename, tapply(get(index), ....)),
or maybe some concoction involving substitute().