0

How can I order two different values of an x attribute, when they share the same value of a y attribute, on the same line? In R

Hi guys, I'va problem with my thesis work and I'm here to get help. I have to manage some data and I've decided to do it through R because there are a lot of data. To decrease the rows I want to perform this operation that I show you graphically: Tab |Attr x attr y| has to become |Attr x attr y| |b1 A | |b1,b2 A | |b2 A | Please help me, of course I'm using sql libraries. What could be the R alg code to solve this operation ? Thanks.

18th Feb 2020, 11:24 AM
Davide De Simone
Davide De Simone - avatar
3 Answers
+ 1
Looks like you want to reshape your data: reshape() (built-in function) or library("reshape") might help
24th Feb 2020, 5:13 PM
Lisa
Lisa - avatar
0
Did you try to make two tables filtering by "Attr x" and then merge (left.join) them by "Attr y" and then merge (unite) both "Attr x"?
17th Apr 2020, 5:53 AM
Diego Lesmes
Diego Lesmes - avatar
0
Actually I think that the spread function apply on "Attr x" works in the same way
18th Apr 2020, 3:42 AM
Diego Lesmes
Diego Lesmes - avatar