I will summarize how I got the dataframes I work with:
     name abundance 
1    joe  1
2    tim  1
3    bob  1
4    joe  1 
5    bob  1
First I created a new dataframe by aggregating the columns and calculated what the relative freqeuency would be:
     name  abundance  relative_ab
1    joe   2          0.4
2    tim   1          0.2
3    bob   2          0.4
But I want to add a column to the first dataframe so that there are redundant entries with the relative_ab like so (the actual data set has other information in it and I would lose the information by aggregating them).
     name abundance relative_ab
1    joe  1         0.4
2    tim  1         0.2
3    bob  1         0.4
4    joe  1         0.4
5    bob  1         0.4
I think I could brute force this but I am relatively new to R and wondering what slick ways you guys might come up with.
Thanks!
 
     
     
     
    