> Date: Thu, 13 Jan 2005 12:42:59 -0800 > From: White.Denis at epamail.epa.gov > > I don't understand this behavior: > > > a <- c(0, 1, 2, 3) > > b <- c(1, 2, 3, 4) > > ifelse (a == 0, 0, b[a]) > [1] 0 2 3 1 > > rather than the desired 0 1 2 3. Thanks for any explanation. > Look at b[a]. Ray