I'm looking for a way to fillNA in duplicated()
rows. There are totally same rows and at one time there is a NA, so I decide to fill this one by value of complete row but I don't see how to deal with it.
Using the duplicated()
function, I could have a data frame like that:
df <- data.frame(
Year = rnorm(5),
hour = rnorm(5),
LOT = rnorm(5),
S123_AA = c('ABF4576','ABF4576','ABF4576','ABF4576','ABF4576'),
S135_AA = c('ABF5403',NA,'ABF5403','ABF5403','ABF5403'),
S13_BB = c('BF50343','BF50343','BF50343','BF50343',NA),
S1763_BB = c('AA3489','AA3489','AA3489','AA3489','AA3489'),
S173_BB = c('BQA0478','BQA0478','BQA0478','BQA0478','BQA0478'),
S234543 = c('AD4352','AD4352','AD4352','AD4352','AD4352'),
S1265UU5 = c('AZERTY', 'AZERTY', 'AZERTY', 'AZERTY','AZERTY')
)
The rows are similar, so how could I feel the NA by the value of the preceding raw (which is not an NA) ? There is no complete.cases()
rows.