i have a data frame with different variables. i have merged three columns of probabilities to my data frame. my question is how can i use these columns as probabilities in sample function so that for prob argument take each column as probability. for example for y= 1 take ncol (a) , for y=1 take ncol(b) and so on my codes are:
a b c y
1 0.090 0.12 0.10 1
2 0.015 0.13 0.09 1
3 0.034 0.20 0.34 1
4 0.440 0.44 0.70 1
5 0.090 0.12 0.10 2
6 0.015 0.13 0.09 2
mydata$mig<- sample( 1:3, size = 7, replace = TRUE, prob= ????)
any help would be appreciated