On Thu, 9 Mar 2006, Omar Lakkis wrote:

> How to do a shift/rotate os a list?
> if
> a = c(1,2,3)
> what is the best way to make a equal
> c(3,1,2)
>

a <- c(a[length(a)],a[-length(a)])

or

n <- length(a)
a <- c(a[n],a[-n])

David Scott
_________________________________________________________________
David Scott     Department of Statistics, Tamaki Campus
                The University of Auckland, PB 92019
                Auckland        NEW ZEALAND
Phone: +64 9 373 7599 ext 86830         Fax: +64 9 373 7000
Email:  [EMAIL PROTECTED]


Graduate Officer, Department of Statistics

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to