Re: [R] Turn any vector

From: Henrique Dallazuanna <wwwhsd_at_gmail.com>
Date: Thu, 10 Jul 2008 09:01:37 -0300

See ?rev

On Thu, Jul 10, 2008 at 8:56 AM, Zroutik Zroutik <zroutik_at_gmail.com> 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[j] <- i[length(i)-j+1]
>
> now, i_turned is what I call turned. Is there a function which would make a
> script lighter? Thank you upfront for any hint.
>
> Best regards,
> Zroutik
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_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.
>

-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

______________________________________________
R-help_at_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.
Received on Thu 10 Jul 2008 - 12:07:32 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 10 Jul 2008 - 12:31:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive