25 September 2021 4 9K Report

I need to create a new variable (NewVAR) based on the lowest value of FOUR other variables which is easy to me using R Code. BUT I need to enter name of that Variable with lowest value in the new variable (NewVAR). I can do it manually for few observations but I need to do this for 1000 observations. However, I do not know how to solve this problem using R code. Please see the following example. Any help is highly appreciated.

ID V1 V2 V3 V4 NewVAR

1 20 10 4 5 V3

2 10 1 4 6 V2

3 30 9 6 2 V4

....

More Proloy Barua's questions See All
Similar questions and discussions