I am struggling with those for loops because the dataframe is quite large (250 000 rows) and it takes a long long time and I don't how to put apply function in this. Can you please help me??
for(j in 1:nrow(df) ){
  if(is.na(df[j, 5]) == FALSE ) {
    for (k in 1:nrow(d)f){
      if(d[df,1] == df[j,1] && is.na(df[k,5]) == TRUE ){
        df[k,5] = df[j,5]
      }
    }
  } 
}
Thank you so much!
 
    