rewrite_na | R Documentation |
rewrite the NA values in a tibble by another tibble
rewrite_na(x, y, by)
x |
raw tibble |
y |
replace reference tibble |
by |
columns to align the tibbles |
tibble
tb1 <- tibble::tibble(
id = c("id-1", "id-2", "id-3", "id-4"),
group = c("a", "b", "a", "b"),
price = c(0, -200, 3000, NA),
type = c("large", "none", "small", "none")
)
tb2 <- tibble::tibble(
id = c("id-1", "id-2", "id-3", "id-4"),
group = c("a", "b", "a", "b"),
price = c(1, 2, 3, 4),
type = c("l", "x", "x", "m")
)
rewrite_na(tb1, tb2, by = c("id", "group"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.