It looks like I found a solution from another source (R - Replace Column Value with Another Column - Spark By {Examples}):
mutate(depth2_cm = ifelse(depth2_cm == 'NA', depth1_cm, depth2_cm))
It works! Posting in case it is useful to someone.
It looks like I found a solution from another source (R - Replace Column Value with Another Column - Spark By {Examples}):
mutate(depth2_cm = ifelse(depth2_cm == 'NA', depth1_cm, depth2_cm))
It works! Posting in case it is useful to someone.