I have the following table:
#Rainfall(PCP-minimum) #Rainfall(PCP-maximum) #Rainfall_index(DRI)
0 - 4.9 0
5 - 9.9 1
10 - 14.9 2
So the general formula is:
5*n - 5*n+4.9 n
I would like to code such table using R to get the variable DRI
So if PCP is between 0-4.9 then DRI= 0 and if PCP between 5-9.9 then DRI = 1 and so on so the general rule that If PCP between 5n- 5n+4.9 then DRI = n
Thanks in Advance