I have an R dataframe like so:
TS Wafer(1)Radius(38) Wafer(1)Radius(49) Wafer(2)Radius(06) Wafer(2)Radius(38)
2022-06-29T02:33:34.827582 699.565925 699.726346 700.526022 700.820165
2022-06-29T02:33:42.277582 700.053016 700.081032 700.558847 700.367924
2022-06-29T02:33:49.727582 699.707056 699.761278 700.485359 700.958339
2022-06-29T02:33:57.169972 699.909119 700.04703 700.419578 700.565945
2022-06-29T02:34:04.617582 699.74137 699.698093 700.397555 700.533587
2022-06-29T02:34:12.067582 700.106121 699.868698 700.573662 700.611651
I would like to get the min/max/mean for each Wafer grouped by each row.
For example, for the first row/TS, the max for Wafer(1) would be 699.726346. The max for Wafer(2) would be 700.820165. This would continue down the rows for each TS.
I know there is a pmax() function that can find the max/min across multiple columns but how do I group it to wafer1, wafer 2 etc?
Also I would like to apply other statistics such as mean median etc.
Is this possible?
Expected result would be something like:
TS Wafer(1)Radius(38) Wafer(1)Radius(49) Wafer(2)Radius(06) Wafer(2)Radius(38) Wafer1_Max wafer2_max wafer1_min wafer2_min wafer1_mean wafer2_mean
2022-06-29T02:33:34.827582 699.565925 699.726346 700.526022 700.820165 699.726346 700.820165 699.565925 700.526022 699.6461355 700.6730935
2022-06-29T02:33:42.277582 700.053016 700.081032 700.558847 700.367924 700.081032 700.558847 700.053016 700.367924 700.067024 700.4633855
2022-06-29T02:33:49.727582 699.707056 699.761278 700.485359 700.958339 699.761278 700.958339 699.707056 700.485359 699.734167 700.721849
2022-06-29T02:33:57.169972 699.909119 700.04703 700.419578 700.565945 700.04703 700.565945 699.909119 700.419578 699.9780745 700.4927615
2022-06-29T02:34:04.617582 699.74137 699.698093 700.397555 700.533587 699.74137 700.533587 699.698093 700.397555 699.7197315 700.465571
2022-06-29T02:34:12.067582 700.106121 699.868698 700.573662 700.611651 700.106121 700.611651 699.868698 700.573662 699.9874095 700.5926565