I have the following data frame, and am trying to merge the two columns into one, while replacing NA\'s with the numeric values.
NA
ID A B 1
You can also do: with(d,ifelse(is.na(A),B,A))
with(d,ifelse(is.na(A),B,A))
where d is your data frame.
d