I have a data frame like this:
Keyword 1 2 3 4 5 a 0.7 NA NA 0.3 0.4 b NA NA 0.5 NA NA c NA 0.2 NA NA 0.3 d NA NA NA 0.3 0.4
I would like to get it so that the results give me this:
Keyword First Value a 1 0.7 b 3 0.5 c 2 0.2 d 4 0.3
How can i do this?
Thanks.
The solution worked by miracles.
What if I want the last value so that the result looks like this:
Keyword Last Value a 5 0.4 b 3 0.5 c 5 0.3 d 5 0.4
I cannot determine which index to change.
Thanks.
source share