-1

df1 and df2

I have one df1 and I want to merge certain rows of specific columns based on the names of another column

Henrik
  • 61,039
  • 13
  • 131
  • 152
mk894
  • 33
  • 6

1 Answers1

1

An option is aggregate by specifying a formula with the rhs specifying the grouping column ('Name') and . for all the others ('Likes', 'How many hrs spend liking') and paste them together

aggregate(. ~ Name, df1, FUN = toString)
akrun
  • 789,025
  • 32
  • 460
  • 575