Re: [R] Repeat a loop until...

2011-10-19 Thread Dénes TÓTH
If you want to generate truncated distributions, package 'tmvtnorm' can help you out. Regards, Denes >> >> Dear all, >> >> I know there have been various questions posted over the years about > loops >> but I'm afraid that I'm still stuck. I am using Windows XP and R 2.9.2. >> I am generati

Re: [R] Repeat a loop until...

2011-10-19 Thread Petr PIKAL
Hi I may be completely off track without knowing mnormt package but what about using while loop for counting rows in "correct" datamat. #first set your matrix datamat <- rmnorm(n=1500,mean=c(mean(sanad[,1]),mean(sanad[,2]),mean(sanad[,3])),varcov=covmat) #get rid of out of spec values datamat

[R] Repeat a loop until...

2011-10-18 Thread Bonnett, Laura
Dear all, I know there have been various questions posted over the years about loops but I'm afraid that I'm still stuck. I am using Windows XP and R 2.9.2. I am generating some data using the multivariate normal distribution (within the 'mnormt' package). [The numerical values of sanad and cov