'R a factor sampling methode

I would like to produce a direct sampling with the following object :

v <- c("piment","aubergine","carotte","oignon","chou","pommeDeTerre","Na")
n <- 12

## TEST 1 : crach R
tmp <- data.frame(matrix(rep(v,n), ncol = n))
expand.grid(tmp)

But this will produce a matrix of too large size (2.176782336e+9 possibilities). So I have to study a sampling, but I don't know how to make it representative of my population.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source