Skip to content
Prev 378543 / 398502 Next

Select

On 2019-02-11 23:35, Val wrote:
How about

x <- sample(1:5)

total <- mydat$count[x[1]]
i <- 1
while (total < 40){
     i <- i + 1
     total <- total + mydat$count[x[i]]
}

print(mydat$group[x[1:i]])

G?ran