ourMELONS/R/rand_disc.R
Waldir Leoncio fca9caa731 Restyled files
Ran through styler::style_dir() in the R and tests directories in preparation for #23.
2021-11-10 14:25:50 +01:00

7 lines
191 B
R

rand_disc <- function(CDF) {
# %returns an index of a value from a discrete distribution using inversion method
slump <- rand
har <- find(CDF > slump)
svar <- har(1)
return(svar)
}