I have a code simulating N throws of a dice and I have managed to plot in a histogram with ggplot2. This is the code:
N <- 10000
Dice_Throws <- function(N) {
Collected_Result <- sample (x = 1:6, size = N, replace = TRUE)
return(Collected_Result)
}
vec <- sample (x = 1:6, size = N, replace = TRUE)
df <- data.frame(Dice = vec)
ggplot(df, aes(Dice))+
geom_histogram(bins = 30)
If I now want to count the outcome for a certain number on the dice, how can I go about that? I just recently started learning and I've tried searching around a bit but just can't understand it.
Thank you kindly for any help.