Q:

Repeat loop in r until the values in one column are less than several other columns

I have a data set df where the last column (value) consists of sampled values. In the same data set I have several other columns (rep1:rep4) whose values need to be less than the sampled value in the same row. If this criteria isn't met, I need to resample the the value column and try again. This needs to be repeated until the numbers in rep1:rep4 are less than corresponding number in the value column.  
I'm still trying to get a handle on loops, but it seems that a while loop might be what to use here. 

    ID  rep1  rep2  rep3  rep4  value
1   a   NA    NA    NA    NA    -400
2   b   -400  NA    NA    NA    -300
3   c   -400  -300  NA    NA    -200
4   d   -400  -300  -200  NA    -300
5   e   -400  -300  -200  -300  -400
6   f   NA    NA    NA    NA    -400
7   g   -400  NA    NA    NA    -400
8   h   NA    NA    NA    NA    -400
9   i   NA    NA    NA    NA    -200
10  j   -200  -300  NA    NA    -300
11  k   -300  NA    NA    NA    -200
12  l   NA    NA    NA    NA    -300
13  m   NA    NA    NA    NA    -300

structure(list(ID = structure(1:13, .Label = c("a", "b", "c", 
"d", "e", "f", "g", "h", "i", "j", "k", "l", "m"), class = "factor"), 
    rep1 = c(NA, -400L, -400L, -400L, -400L, NA, -400L, NA, NA, 
    -200L, -300L, NA, NA), rep2 = c(NA, NA, -300L, -300L, -300L, 
    NA, NA, NA, NA, -300L, NA, NA, NA), rep3 = c(NA, NA, NA, 
    -200L, -200L, NA, NA, NA, NA, NA, NA, NA, NA), rep4 = c(NA, 
    NA, NA, NA, -300L, NA, NA, NA, NA, NA, NA, NA, NA), value = c(-400L, 
    -300L, -200L, -300L, -400L, -400L, -400L, -400L, -200L, -300L, 
    -200L, -300L, -300L)), class = "data.frame", row.names = c(NA, 
-13L))

This is the start of what I have:
while(df$value < df$rep1:df$rep4) { repeat sampling process }

The sampling process is a multiple step procedure which I can include if necessary, but might overly complicate things. From my limited understanding of loops, if I follow while with conditions that do not meet my intended results, it will continue the loop (in my case resampling) until the time when the resampled data in every row of the value column are greater than the values in columns rep1 to rep4.  
This brought up several errors (no surprise): an NA/NaN argument, and several errors stating that despite the numerical expressions of df$rep1:df$rep4 having multiple elements, only the first was used.
For the NA/NaN argument, I am guessing that the issue is that not all rows of the rep columns are filled, making it impossible to compare values with those in the value column. For the issue of only the first element being used, I'm not sure if that is because the NA/Nan broke things, so it couldn't continue, or if the code needs to specify that all rows are checked. 
The intended output for this is the dataframe itself. If it passes the loop requirements, the dataframe will be valid and I can continue forward with that data. 

A:

Suppose 
1) we ignore NAs in the calculations
2) The sampling process is to add 100 when the value is not the highest value
for (i in 1:nrow(df)){
  while (any(df$value[i]<=as.numeric(df[i,2:5])%>%na.omit())){
    df$value[i]=df$value[i]+100} #Here you should replace with your sampling process
}

> df
   ID rep1 rep2 rep3 rep4 value
1   a   NA   NA   NA   NA  -400
2   b -400   NA   NA   NA  -300
3   c -400 -300   NA   NA  -200
4   d -400 -300 -200   NA  -100
5   e -400 -300 -200 -300  -100
6   f   NA   NA   NA   NA  -400
7   g -400   NA   NA   NA  -300
8   h   NA   NA   NA   NA  -400
9   i   NA   NA   NA   NA  -200
10  j -200 -300   NA   NA  -100
11  k -300   NA   NA   NA  -200
12  l   NA   NA   NA   NA  -300
13  m   NA   NA   NA   NA  -300

