Re: [R] generate levels with different number of replications with gl() function

2016-02-10 Thread David Barron
Why not use rep instead of gl: levels <- c('BR', 'CNS', 'CO', 'LE', 'ME', 'LC', 'OV', 'PR', 'RE') reps <- c(4, 6, 7, 6, 10, 9, 7, 2, 8) rep(levels, reps) David On 10 February 2016 at 05:02, hehsham alpukhity via R-help < r-help@r-project.org> wrote: > I am trying to use the function gl (generat

[R] generate levels with different number of replications with gl() function

2016-02-09 Thread hehsham alpukhity via R-help
I am trying to use the function gl (generate levels with different number of replications), generate different number of replications in each level.examplei have factor with this levels (BR,CNS ,CO,LE,ME,LC,OV,PR,RE),  and the replications is not the same , i want (4 replication for BR),( 6 repl