I am trying to use the function gl (generate levels), and would like to make levels with different number of replications. Does anyone know how to generate different number of replications in each level? Something like: [1] Site1 Site1 Site1 Site1 Site1 Site1 Site1 [8] Site2 Site2 Site2 Site2 Site2 Thanks in advance -- Rog?rio R. Silva MZUSP mz.usp.br Linux/Debian User # 354364 Linux counter counter.li.org
Can't do it. gl is based on rep(), which easily does what you want: factor(rep(c('Site1','Site2'),c(7,5))) -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA "The business of the statistician is to catalyze the scientific learning process." - George E. P. Box> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of > Rog?rio Rosa da Silva > Sent: Wednesday, February 09, 2005 12:25 PM > To: r-help at stat.math.ethz.ch > Subject: [R] gl and different number of replications > > I am trying to use the function gl (generate levels), and > would like to make > levels with different number of replications. Does anyone know how to > generate different number of replications in each level? > > Something like: > > [1] Site1 Site1 Site1 Site1 Site1 Site1 Site1 > [8] Site2 Site2 Site2 Site2 Site2 > > Thanks in advance > -- > Rog?rio R. Silva > MZUSP mz.usp.br > Linux/Debian User # 354364 > Linux counter counter.li.org > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > R-project.org/posting-guide.html >
Rogério Rosa da Silva <rrsilva <at> ib.usp.br> writes: : : I am trying to use the function gl (generate levels), and would like to make : levels with different number of replications. Does anyone know how to : generate different number of replications in each level? : : Something like: : : [1] Site1 Site1 Site1 Site1 Site1 Site1 Site1 : [8] Site2 Site2 Site2 Site2 Site2 : gl(2,7,12, lab = "Site")