[R] Merge rows

Sarah Goslee sarah.goslee at gmail.com
Fri Jul 11 18:27:55 CEST 2014


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

On Fri, Jul 11, 2014 at 12:19 PM, Ryan de Vera <ryan.devera.03 at gmail.com> wrote:
> Hello all,
>
> I have a data frame filled with senders and recipients. Some of the senders
> have multiple rows with different recipients and I want to merge those
> rows. For example I have
>
> a at email.com     b at email.com
> a at email.com     c at email.com     d at email.com
> r at email.com      f at email.com
> r at email.com      h at email.com
>
> I want this to become
>
> a at email.com     b at email.com     c at email.com     d at email.com
> r at email.com      f at email.com      h at email.com
>
> How would I go about doing this?
>
>         [[alternative HTML version deleted]]

^^^ That is part of the problem!

-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list