Skip to content
Prev 177121 / 398503 Next

performing function on data frame

Hi!

First, pardon me if this is a faq. I think I should be using some sort
of apply, but I am not managing to figure those out.

I have a data frame similar to this:
x          y          z
1 A  0.1605464 -0.2719820
2 B -0.9258660  1.2623117
3 C -0.3602656  1.5470351
4 D  1.2621797  1.2996500
5 E  0.6021728  0.5027095
based on the values found in each row. For instance for element [C,y],
I would like to calculate (-0.3602656 - mean(column y)/stddev(column
y)).

Thanks!