Re: [R] Help with rep

From: Dimitris Rizopoulos <dimitris.rizopoulos_at_med.kuleuven.be>
Date: Fri, 25 Jul 2008 11:22:10 +0200

try this:

st <- 5
unlist(lapply(st:1, seq, to = st))

I hope it helps.

Best,
Dimitris



Dimitris Rizopoulos
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium

Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
     http://perswww.kuleuven.be/dimitris_rizopoulos/


> Hi
> Is it possible to use the rep command (or maybe some other
> "shortcut") to create a vector with the following format:
> 4 3 4 2 3 4 1 2 3 4
>
> Any help is much appreciated.
> Thanks
> Jacob
>
>
> Jacob L van Wyk
> Department of Statistics
> University of Johannesburg, APK
> Box 524
> Auckland Park 2006
> South Africa
> Office Tel: +27 11 559 3080
> Fax: +27 11 559 2832
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_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.
>

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm



R-help_at_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. Received on Fri 25 Jul 2008 - 09:28:04 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 25 Jul 2008 - 10:32:45 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.

list of date sections of archive