You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If missing value appears first in its key and it needed to be replaced by last observed value, it doesn't leave it with NA and cares last observed value from previous key (group).
harvest <- tsibble(
year = c(2011, 2013, 2014, 2010, 2012, 2014),
fruit = rep(c("kiwi", "cherry"), each = 3),
kilo = sample(1:10, size = 6),
key = id(fruit), index = year
)
harvest_fill <- fill_na(harvest, .full = TRUE)
harvest_fill %>%
group_by_key() %>% # I've tried also group_by
tidyr::fill(kilo, .direction = "down")
2010 kiwi observation need to be leaved with NA. I accomplished it by:
If missing value appears first in its key and it needed to be replaced by last observed value, it doesn't leave it with NA and cares last observed value from previous key (group).
2010 kiwi observation need to be leaved with NA. I accomplished it by:
The text was updated successfully, but these errors were encountered: