I have a data with millions of rows. i want to do some data manipulations in R.
The below image describes the conditions. I want final result stored in Result variable. Here NA means not applicable for this logic.
Outputdata is my final dataset. Create a new variable Result and insert values according to below conditions.
Case 1: If Lost = 1 and PPP >= 0.8 then Result = PPP Case 2: If Lost = 1 and PPP < 0.8 then Result = 0.935294
Also, if Result is non blank then apply Case 2 for those rows. If Result has a value due to previous cases don't over write the value.
Please help me. R is very new for me.