I have a data frame that want to get summary from row and group by (id) data set and summarise them , but give me mean column v for any row and not sum cloumn v and divide any row.
data.frame(id = c("a", "b", "c"), value = c(25, 35, 45, 15, 20, 55)) %>%
group_by(id) %>%
summarise(v = n(), m = mean(v))
id v m
<fct> <int> <dbl>
1 a 2 2
2 b 2 2
3 c 2 2
i wnat this type of mean cloumn
id v m
<fct> <int> <dbl>
1 a 2 0.3333333
2 b 2 0.3333333
3 c 2 0.3333333