Suppose that I gave a treatment to some column values of a data frame like this:
id animal weight height ... 1 dog 23.0 2 cat NA 3
Isn't dplyr::rows_update exactly what we need here? The following code should work:
dplyr::rows_update
df %>% dplyr::rows_update(sub_df, by = "id")
This should work as long as there is a unique identifier (one or multiple variables) for your datasets.