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
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
the function /rev / REVERSEs the order of the vector, as
v= c(1,2,3)
rev(v)= 3,2,1
if you want the opposite value , just add a exclamation in front of the
vector:
v=c(T,F,T,T);
!v is F,T,F,F
--
View this message in context:
http://r.789695.n4.nabble.com/question-about-rev-tp4268518p4268716.html
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?
Thanks
My best
[[alternative
4 matches
Mail list logo