Maybe: do.call(rbind, lapply(with(xy <- rbind(x, y), split(xy, list(a, b), drop = TRUE)), tail, 1))
On Fri, Sep 11, 2009 at 3:45 AM, jo <jo.li...@gmail.com> wrote: > Thanks for the post-processing ideas. But is there any way to do that > in one step? > > On Thu, Sep 10, 2009 at 7:20 PM, Henrique Dallazuanna <www...@gmail.com> > wrote: > > > > Try this: > > > > xy <- merge(x, y, by = c("a","b"),all = TRUE) > > xy$c <- ifelse(rowSums(!is.na(.x <- xy[, c('c.x', 'c.y')])) > 1, .x[,1], > rowSums(.x, na.rm = TRUE)) > > xy > > > > On Thu, Sep 10, 2009 at 12:21 PM, JiHO <jo.li...@gmail.com> wrote: > > JiHO > --- > http://maururu.net > -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[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.