Depending upon what you are doing next, you may prefer the data in a nested form.
(nested <- df %>%
group_by(name) %>%
summarize(
age = na.omit(age)[1],
birthplace = na.omit(birthplace)[1],
value = list(value)
)
)
## # A tibble: 4 x 4
## name age birthplace value
##
## 1 A 28 city1
## 2 B NA city2
## 3 C NA NA
## 4 D 53 NA
If you need to compute on individual values, you can always unnest it later.
nested %>% tidyr::unnest()
## # A tibble: 8 x 4
## name age birthplace value
##
## 1 A 28 city1 100
## 2 A 28 city1 101
## 3 B NA city2 102
## 4 B NA city2 103
## 5 B NA city2 104
## 6 C NA NA 105
## 7 D 53 NA 106
## 8 D 53 NA 107