> I wonder if there is any swap function in R that does the following:
> x <- seq(1,10,12)

This just makes x equal to 1.  I'm guessing you meant something like
x <- 1:10

> x1 <- swap(x)
> x1 
> 1 8 3 4 5 6 7 2 10

It's not terribly clear what you want swap to do.  You can reorder the 
elements of x using sample, e.g.
sample(x)
[1]  6 10  8  4  2  5  1  9  3  7

Regards,
Richie.

Mathematical Sciences Unit
HSL


------------------------------------------------------------------------
ATTENTION:

This message contains privileged and confidential inform...{{dropped:20}}

______________________________________________
R-help@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.

Reply via email to