I didn't see any post solving my problem.

I have a two column data frame. Specifically it has two factors with 11985 and 20200 levels, respectively. The levels of the two two factors are combined to give a total of 849472 observations. Here's an example of the data frame:

```
Category    Gene
BP0000      Fp91000
BP0001      Fp82000
BP0002      Fp70000
BP0010      Fp72000
BP0021      Fp30000
BP0021      Fp30020 
BP0001      Fp30000
BP0000      Fp82000    

```

I want to keep in one raw the Category with each factor repeated only one time and in the other column I want in the same cell all the gene that match a category. Here's the format I want:

```
Category    Gene
BP0000      Fp91000 Fp82000
BP0001      Fp82000 Fp30000
BP0002      Fp70000
BP0010      Fp72000
BP0021      Fp30000 Fp30020  

```

I've already tried with match but I only get one match of the gene column an there are multiple match's. I'm sorry if this was already post in other question but I didn't see anything like this.