Re: [R] generating a sequence

About this list Date view Thread view Subject view Author view

royle@penguin.irm.r9.fws.gov
Tue, 21 Dec 1999 10:02:50 -0500 (EST)



Funny I had this same problem last week. Use the function "sequence"
like:

sequence(4:1)
 [1] 1 2 3 4 1 2 3 1 2 1

kind regards
andy

---------------------------------------------------------------------
J. Andy Royle, U.S. Fish and Wildlife Service - Office of Migratory
Bird Management; 11510 American Holly Drive , Laurel, MD 20708-4017;
phone - 301-497-5673 fax - 301-497-5706 email - royle@penguin.fws.gov
---------------------------------------------------------------------

On Tue, 21 Dec 1999, KAREN KOTSCHY wrote:

> Hi everyone
>
> I'm trying to generate a vector of the form
> a <- c(1,2,3,4,1,2,3,1,2,1) where n = 5
> in a general way, where n can be any positive integer.
>
> I've run out of ideas. Does anyone have any suggestions?
>
> Thanks
> Karen
> Karen Kotschy
> Centre for Water in the Environment
> University of the Witwatersrand
> Johannesburg
>
> Tel: 011 716-2218
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !) To: r-help-request@stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b3 on Tue 04 Jan 2000 - 13:34:03 EST