My question concern programming in R. My data set looks like this: enter image description here
I'd like to fill empty (blanks not NA) rows from column id_code
with appropriate values coming form column distribution.type
.
My idea was used i.e mutate
function mutate(df$distribution.type [ifelse(df$id_code == "", df$distribution.type, df$id_code)])
or something like this:
df$id_code[df$id_code == ""] <- df$distribution.type[df$id_code == ""]
and a plenty of another concepts, but they didn't work. May I ask for your help ?