How can I write a conditional function that compares entries in rows of a data frame in R. For example if entry in row 1 is greater than entry in row 2 replace row 2 entry with "lower"
row1 row2
667 668
673 674
665 679
664 668
Entries in first column will be higher,lower,lower if the function is applied.