Hello every one,
I am new to R studio and I am trying to draw bar plots for a specific problem, which has multiple conditions. the problem is:
A producer guarantees that germinability of one special pea cultivar is 50%. A gardener bought 50 pea seeds.
Calculate the probability that:
- all seeds will sprout,
- at most 5 seeds will sprout,
- at least 4 seeds will sprout.
- and so on...
Now, how can I draw bar plots for these? I am currently having this solution:
xP50 <- c(0:50)
prob1 <- dbinom(xP50,50,0.5)
tab1 <- data.frame(value = xP50, probability = prob1)
barplot(tab1$probability)
and for the second one, I have:
xP5 <- c(0:50)
prob2 <- dbinom(xP5,50,0.5)
tab2 <- data.frame(value = xP5, probability = prob2)
barplot(tab2$probability)
Is this the right way, to achieve the bar plots? Am I doing it correctly?
Thank You.