Yes£¬I find out later.

rev is only reverse the order.
What I use is !




Thanks





At 2012-01-06 16:07:11,"Petr PIKAL" <petr.pi...@precheza.cz> wrote:
>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@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.
>

        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to