To accomplish this in R, we may use the probspace function. The general syntax is probspace (x,probs),where x is a sample space of outcomes and probs is a vector ( of the same length as the number of outcomes in x ). The specific choice of probs depends on the context of the problem, and some examples follow to demonstrate some of the more common choices.