Hi John, I don't think your x2 is right, but who knows?
One possible approach would be: R> lapply(split(x2$recipients, unique(x2$sender)), paste, collapse=", ") $`a...@email.com` [1] "b...@email.com, f...@email.com" $`r...@email.com` [1] "c(\"c...@email.com\", \"d...@email.com\"), h...@email.com" but again, who knows exactly what the OP wants? You sent this just to me; I've copied the R-help list back again. Sarah On Fri, Jul 11, 2014 at 3:19 PM, John McKown <john.archie.mck...@gmail.com> wrote: > On Fri, Jul 11, 2014 at 11:27 AM, Sarah Goslee <sarah.gos...@gmail.com> wrote: >> Hi Ryan, >> >> We can't tell from your example what structure your original data are >> in, nor what your output is intended to look like, or for that matter >> how you got from one to the other. Please don't post in HTML because >> it gets mangled! >> >> Using dput() to provide your example data is the best thing, because >> that preserves R structures. And an R-format example of your desired >> output would also be helpful. >> >> Sarah > > In a, perhaps vain, attempt to be helpful, I think the following > output from what I constructed myself will show what the OP was > talking about: > >> dput(x2) > structure(list(sender = c("a...@email.com", "a...@email.com", > "r...@email.com", > "r...@email.com"), recipients = list("b...@email.com", c("c...@email.com", > "d...@email.com"), "f...@email.com", "h...@email.com")), .Names = c("sender", > "recipients"), row.names = c(NA, -4L), class = "data.frame") > > I probably should have called it "mailingList" instead of x2, no? > > Now, after "wasting" too much time, perhaps somebody will come up with > a solution. I could "brute force" something (yes, you can write > FORTRAN style code in R!). But have been "sensitized" from doing so by > others. > > -- > There is nothing more pleasant than traveling and meeting new people! > Genghis Khan > > Maranatha! <>< > John McKown -- Sarah Goslee http://www.sarahgoslee.com ______________________________________________ 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.