[R] gl and different number of replications

Berton Gunter gunter.berton at gene.com
Wed Feb 9 21:50:03 CET 2005


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 http://www.mz.usp.br
> Linux/Debian User # 354364
> Linux counter http://counter.li.org
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list