I want to put the name of the people who have some value in some column, grouping by the value to which it belongs. my df is:
name<-c("luis", "John", "Leo")
a1<-c("a","b","a")
a2<-c("b","a","b")
a3<-c(NA,"b","a")
df<-data.frame(name,a1,a2,a3)
I want to get a result like this
a1: a=c("Luis","Leo"), b="John"
a2: a="John", b=c("Luis","Leo")
a3: a="Leo", b="John"