Hi there!
I would like to make corrections to values in a data frame in a concise and reproducible way.
For example, here is the hypothetical (and much smaller) data frame with incorrect values I'm working with.
df <- tibble::tribble(
~id, ~var1, ~var2,
1, 10, "a",
2, 200, "b",
3, 30, "c",
4, 40, "d",
5, 8989, "e",
6, 60, "f"
)
I receive Excel spreadsheets with ids, variables names, and corrected values:
corrections <- tibble::tribble(
~id, ~var1,
2, 20,
5, 50
)
I would like to update my data frame with those corrected values:
df <- tibble::tribble(
~id, ~var1, ~var2,
1, 10, "a",
2, 20, "b",
3, 30, "c",
4, 40, "d",
5, 50, "e",
6, 60, "f"
)
Any suggestions on how to do that?
Thank you very much!
André