-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi,
If the coding would start at 1 rather than 0 then +1's in the penultimate line could be eliminated. Sigbert - --- gene <- c("YAR003W", "YAR007C", "YAR008W", "YBL035C", "YBL111C", "YBL112C") print(gene) to <- c(0,1,3,2) # to <- c(1,2,4,3) from <- c(1,5,4,3) # from <- c(2,6,5,4) gene[to+1] <- gene[from+1] # gene[to] <- gene[from] print(gene) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD4DBQFJ+YKUWvYUYQkj1zkRAjlVAJ9NrHySXnFCUmyBS7XbBwgAeOu1XQCVHvCa omPs62LERNyQJ/+I9uL52g== =seex -----END PGP SIGNATURE----- ______________________________________________ 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.