[R] Re: conditional assignment
uaca@alumni.uv.es
uaca at alumni.uv.es
Thu Jan 29 09:50:45 CET 2004
Hi all again
I could not reply before because I was/am very busy
ifthenelse() is what I wanted, I have to read more carefully your
explanations to better understand it
Thanks everybody
Ulisses
On Mon, Jan 26, 2004 at 08:15:51PM +0100, uaca at alumni.uv.es wrote:
>
> Hi all
>
> I want to conditionally operate on certain elements of a matrix, let me
> explain it with a simple vector example
>
>
> > z<- c(1, 2, 3)
> > zz <- c(0,0,0)
> > null <- (z > 2) & ( zz <- z)
> > zz
> [1] 1 2 3
>
> why zz is not (0, 0, 3) ?????
>
>
> the null <- assignment is to keep the console silent
>
> in the other hand, it curious that null has reasonable values
>
> > null
> [1] FALSE FALSE TRUE
>
> Thanks in advance
>
> Ulisses
>
> Debian GNU/Linux: a dream come true
> -----------------------------------------------------------------------------
> "Computers are useless. They can only give answers." Pablo Picasso
>
> Humans are slow, innaccurate, and brilliant.
> Computers are fast, acurrate, and dumb.
> Together they are unbeatable
>
> ---> Visita http://www.valux.org/ para saber acerca de la <---
> ---> Asociación Valenciana de Usuarios de Linux <---
>
--
Debian GNU/Linux: a dream come true
-----------------------------------------------------------------------------
"Computers are useless. They can only give answers." Pablo Picasso
Humans are slow, innaccurate, and brilliant.
Computers are fast, acurrate, and dumb.
Together they are unbeatable
---> Visita http://www.valux.org/ para saber acerca de la <---
---> Asociación Valenciana de Usuarios de Linux <---
More information about the R-help
mailing list