I want to merge two columns, lat.x and lat.y, so I get a new column, lat.
Data:
lat.x lat.y lat
1 1 1
2 2 2
NA 3 3
4 NA 4
5 6 5
I've tried:
df2$Lat <- ifelse(df$Lat.x == "NA", df$Lat.y, df$Lat.x)
Aucun commentaire:
Enregistrer un commentaire