This may be a very simple question, but I cannot find it. How can I select a random integer from 1 to N in Rcpp? I know that I can try a single number and round it or enable the sample function for use in C ++ code, but both of them do not seem to be correct.
source share