Towards Data Science, Data Analysis, Bayesian Statistics, Data Visualization, Deep Dives.
(response in unique(observations[[group]])) { df <- rbind(df, data.frame(Group = rep(group, sum(observations[[group]] == response)), Response = rep(response, sum(observations[[group]] == response)))) } } head(df) If you look at the R code (in R-studio) at this point, you will notice that the