could anyone tell me where the mistake is ? I have written this: sapply(split(my.datanew2, my.datanew2$country), function(x) {(sd(x)/mean(x))(x$profits,na.rm=T)} and i want