I have a DataFrame consisting of almost 200,000 Observations. The Important columns are similar to (NOTE: The Min Value is not filled by default)
Key Value Min Value
1xA 1 1
2xA 2 2
3xB 3 2
1xB 1 1
1xA 5 1
2xB 2 2
3xB 2 2
2xA 4 2
How can achieve this to fill the Min Value column in R? I tried looping in the dataframe and finding minimum of a subset created for key while checking that particular observation, and it worked fine. But it takes too much time to carry out the 200,000 Observation iteration.
My Thoughts: I was thinking if there was any way to filter out using which() for every observation in one go so that I can find the min. then and there?