change the values in duplicate rows

I have created duplicate rows in dataset. Now i want to change some values in duplicate rows with out changing them in original rows.

is this code correct??

if (leve$time == 0) {print(leve2$DV == NA)}

and i also want to change some values in original rows with out changing them in duplicate rows.

Thankyou

If() is not vectorised so will only look at the first value given.
ifelse() is vectorised.
Read about it and see example by
?ifelse
In the console

1 Like