Hello, For reasons unclear to me I am getting above error message when I change the value of b in the following code:
rm(list=ls()) library("Hmisc") set.seed(4) #seems to have an effect on t(apply b=10 pop.props = c(0.6,0.2,0.2) x=matrix(pop.props,nrow=nn,ncol=length(pop.props), byrow=T) print(x) habs = rMultinom((x),b) print(habs) habs=t(apply(habs, 1, table))/b # works for b=10, but not for b=5??? Also when i run this code in the iteration loop, it seems that changing seed value also has an effect on whether I get the code to run in entirety, or if it chokes with the above error message. I thank you in advance for your help, -- View this message in context: http://r.789695.n4.nabble.com/non-numeric-argument-to-binary-operator-tp3598160p3598160.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.