R command like rowfirst in Stata

#1
Hi, I would like to be able to take the first non missing value in two columns of data in R as shown in the attached image (CREDIT2002, CREDIT2004) to create the new variable CREDIT_FIRST. Capture.JPG