Hi,

Is there a way to apply the diff operator over a large data frame, by groups in a single function?

I have a toy data frame that looks like this:

MEASUREMENT              BLOCK                  TRATMENT         VALUE1               VALUE2
1                                             1                             T-01                       15                           1
1                                             1                             T-02                       32                           2
1                                             2                             T-01                       21                           5
1                                             2                             T-02                       32                           6
2                                             1                             T-01                       19                           5
2                                             1                             T-02                       37                           2
2                                             2                             T-01                       29                           3
2                                             2                             T-02                       36                           6
3                                             1                             T-01                       21                           21
3                                             1                             T-02                       45                           22
3                                             2                             T-01                       38                           32
3                                             2                             T-02                       40                           31
.
.
.

What I would like to calculate is a dataframe that takes the difference between measurements over the same BLOCK-TRATMENT for VALUE1 and VALUE2

Any one know?

Cheers,

Cristián Montes

	[[alternative HTML version deleted]]

