rSample.RdCpp function: Sample from Categorical distribution
rSample(Prob)
| Prob | A matrix with n row and p column. Each column represent a class. The ith row is the probability distribution of ith sample. |
|---|
A matrix of n row and p column. The ith row draw one sample from categorical distribution with probability in the ith row in Prob.