Re: [R] incorrect correlation coefficients

2014-07-27 Thread Patrick Burns
If the argument to the function you give in the 'by' call were 'z' instead of 'x', then it would have been easier to see what was wrong. You are using 'xx' inside the function rather than 'x'. I think you want something like: function(z) {cor(z$Data1.MEAN, z$Data2.MEAN)} Pat On 27/07/2014

[R] incorrect correlation coefficients

2014-07-27 Thread Mateusz Kędzior
Hello all, I strongly believe, that my issue is quite easy to resolve. However, I have no idea how to find/debug what is wrong and I would blame myself for insufficient knowledge about data tables and some useful functions in R! as apply, sapply, lapply. My question is as follows: I would like t