Re: [R] sequence that counts up and back down

2009-02-05 Thread Dimitris Rizopoulos
one way is the following: 5 - abs(-4:4) I hope it helps. Best, Dimitris Monte Milanuk wrote: I hit a minor sticking point working one of the problems in 'Using R' (Verzani). I'm having difficulty with generating a sequence that goes 1, 2, 3, 4, 5, 4, 3, 2, 1. I can make one that counts up

[R] sequence that counts up and back down

2009-02-05 Thread Monte Milanuk
I hit a minor sticking point working one of the problems in 'Using R' (Verzani). I'm having difficulty with generating a sequence that goes 1, 2, 3, 4, 5, 4, 3, 2, 1. I can make one that counts up, I can make one that counts down, etc. but one that counts up then down like this (short of just