You are trying to summarize a non-existant tibble or data.frame. You need to be summarizing a variable in sample_final
Try this"
sample_final <- data.frame(a = rep(1:2, 10, replace = TRUE),b = rep(c("x", "y"), 10, replace = TRUE), c = c(1,3,7,9,5,12,4, 5,9,6))
y <- sample_final %>%
group_by(a, b) %>%
summarise(avg= mean(c))