I have a table looking like this:
A B
aa bb
aa
aa bb
And I want to Check if a data frame cell is blank and if yes find a result table like this:
A B S
aa bb bb
aa aa
aa bb bb
I'm using this code but it doesn't work
for(k in dim(df))
if (df$BB == ""){
df$S <- df$AA
}else {df$S <- df$BB}
Aucun commentaire:
Enregistrer un commentaire