[R] question about rev

Petr PIKAL petr.pikal at precheza.cz
Fri Jan 6 09:05:59 CET 2012


Hi

> [R] question about rev
> 
> Hi,all:
> I have a vector,and wanna get the opposite value via rev function.
> 
> 
> > a
> [1] FALSE FALSE  TRUE  TRUE  TRUE
> > 
> > rev(a)
> [1]  TRUE  TRUE  TRUE FALSE FALSE
> > 
> 
> 
> I don't know why the 3rd "TRUE" has not been reversed,while all other 
> values are reversed?

Misunderstanding what rev function does.

see

letters
rev(letters)
!a

Regards
Petr


> 
> 
> 
> 
> Thanks 
> 
> 
> My best
>    [[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.



More information about the R-help mailing list