How do I implement the following: Create a Gaussian mixture model sampler. In this sampler, a datum has a 40% chance of being sampled from a N(-1,1) distribution, and a 60% chance of being sampled from a N(2,1/9) distribution. Sample 100,000 data and create a density histogram of your result. In R.
I'm supposed to use sample(), but I am unsure of which vector to use in prob = "". Any help/guidance is much appreciated, thank you!