On Jan 10, 2008, at 9:48 PM, Peter McMahan wrote: > y <- matrix(rep(y,ncol(x)),nrow=nrow(y)) > x[is.na(x)] <- y[is.na(x)] oops, i meant: y <- matrix(rep(y,ncol(res)),nrow=nrow(y)) res[is.na(res)] <- y[is.na(res)]