On Sun, Mar 7, 2010 at 4:28 AM, Jim Lemon <j...@bitwrit.com.au> wrote: > On 03/06/2010 09:35 AM, j verzani wrote: >> >> ... >> Sorry about that one. On the errata page I have: >> >> page 16, exercise 1.12 #5 >> This one is most easily done using c() and the sequence operator :. >> (Please >> ignore request to use just seq and rep.) >> > And all over the world, perhaps even on other planets where anonymous R > helpers lurk, the readers of the list can cease their trichotillomania and > get a good night's sleep. >
Thank goodness. Anyways freed from that constraint here is another solution: pmin(1:9, 9:1) This does not use c or rep but does use seq and pmin and has a certain pleasing symmetry to it. ______________________________________________ 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.