Thanks all of you. It's really catchy name for the wanted function
("reverse"), somehow I could not find it unfortunately :( Z
On Thu, Jul 10, 2008 at 2:04 PM, Gabor Csardi <[EMAIL PROTECTED]> wrote:
> It is called 'rev', see ?rev.
>
> > rev(1:10)
> [1] 10 9 8 7 6 5 4 3 2 1
>
> G.
>
> O
Is this what you want:
> x <- 1:10
> x
[1] 1 2 3 4 5 6 7 8 9 10
> rev(x)
[1] 10 9 8 7 6 5 4 3 2 1
>
On Thu, Jul 10, 2008 at 7:56 AM, Zroutik Zroutik <[EMAIL PROTECTED]> wrote:
> Dear R-users,
>
> I'd like to turn a vector so it starts with it's end. For better
> understanding
> rev(1:10)
[1] 10 9 8 7 6 5 4 3 2 1
>
Javier
> Dear R-users,
>
> I'd like to turn a vector so it starts with it's end. For better
> understanding, this set of commands will do what I need:
>
> i <- seq(1:10)
> i_turned <- i
> for (j in 1:length(i)) i_turned[j] <- i[length(i)-j+1]
>
It is called 'rev', see ?rev.
> rev(1:10)
[1] 10 9 8 7 6 5 4 3 2 1
G.
On Thu, Jul 10, 2008 at 01:56:58PM +0200, Zroutik Zroutik wrote:
> Dear R-users,
>
> I'd like to turn a vector so it starts with it's end. For better
> understanding, this set of commands will do what I need:
>
> i
See ?rev
On Thu, Jul 10, 2008 at 8:56 AM, Zroutik Zroutik <[EMAIL PROTECTED]> wrote:
> Dear R-users,
>
> I'd like to turn a vector so it starts with it's end. For better
> understanding, this set of commands will do what I need:
>
> i <- seq(1:10)
> i_turned <- i
> for (j in 1:length(i)) i_turned[
Dear R-users,
I'd like to turn a vector so it starts with it's end. For better
understanding, this set of commands will do what I need:
i <- seq(1:10)
i_turned <- i
for (j in 1:length(i)) i_turned[j] <- i[length(i)-j+1]
now, i_turned is what I call turned. Is there a function which would make a
6 matches
Mail list logo