[R] repeating values

From: Anders Bjørgesæter <anders.bjorgesater_at_bio.uio.no>
Date: Fri 08 Sep 2006 - 13:32:01 GMT


Hello

I have 2 two vectors like

x	N
2	3
4	1
5	2

and want to make a new vector

x
2
2
2
4
5
5

i.e. repeat the values in x according to N

Thanks for your help.

Best Regards
Anders



R-help@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 and provide commented, minimal, self-contained, reproducible code. Received on Fri Sep 08 23:37:47 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 08 Sep 2006 - 14:30:04 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.