vendredi 16 avril 2021

What is the R function to make a bunch of random samples? [duplicate]

I am asked to make 15 random samples of size 10 of numbers between 0 to 10 with replacement allowed.

Rather then manually typing sample(x=0:10, size = 10, replace = TRUE) 15 times and assigning the results to 15 objects. Is there a way I can simplify this code to make it so that I don't have to write the same thing 15 times in a row? AKA is there a function that allows me to take 15 random samples of size 10 easily with replacement allowed?




Aucun commentaire:

Enregistrer un commentaire