search for: sarahj

Displaying 1 result from an estimated 1 matches for "sarahj".

Did you mean: sarah
2011 Nov 07
3
Sampling with conditions
...m into the first column of a matrix (which will used later in a loop). However, I need to have those numbers add up to 10. How can I set those conditions? So far I have: n<-matrix(0,nr=5,ncol=10) for(i in 1:10){n[i,1]<-sample(0:10,1)} How do I set-up the "BUT sum(n[i,1])=10"? Thanks SarahJ -- View this message in context: http://r.789695.n4.nabble.com/Sampling-with-conditions-tp4014036p4014036.html Sent from the R help mailing list archive at Nabble.com.