I am trying to generate three probabilities that will necessarily sum to 1. I tried the following:
x <- sample(seq(0.05,0.95,0.05), size=3)
x <- boom/sum(boom)
However, I want the generated numbers to be fractions to two decimal places, i.e, numbers from 0.05 to 0.95 in steps of 0.05 (and so that they also sum to 1). The problem with the numbers generated by the code above is that they can be with many or infinite decimal places. How can I achieve what I need? Has anyone done anything similar?