I have a below sample data frame 

```
df <- data.frame("Group"= c(1,1,2,2,2),"H" = 
c("H1","H3","H3","H4","H2"), "W1" = c(95, 0, 0,0,50) , "W2" = c(0, 
95,95, 0,85),"W3" = c(85, 50,50 ,95,0))

```

Need to calculate two additional Metrics:
1st Metric : Based on each group and rows across w1,w2,w3 of that group if the value is equal or more than 85 for w1, w2 & w3 then output is 100%.
For Example: For Group 2, For w2 & w3, Maximum value is equal more than 85
and For w1 , it is less than 85 so result is **66.7**

2nd Metric : Minimum of maximum of rows across w1,w2,w3 columns of that group. For Example : For Group 2, min(max[0 0 50], max[95 0 85], max[50 95 0]) = **50** 

For more clarity, Here is desired output data frame:

```
DesiredDf <- data.frame("Group"= c(1,1,2,2,2),"H" =     
c("H1","H3","H3","H4","H2"), "W1" = c(95, 0, 0,0,50) , 
"W2" = c(0, 95,95, 0,85), "W3" = c(85, 50,50 ,95,0),
"W" = c(100,100,66.7 ,66.7,66.7),MINMAX = c(85,85,50,50,50))

```

Have tried out for loop and sapply method but the actual data set is too large and execution is too slow.Looking for ways to calculate these metrics more seamlessly in R.