I have a paired data value dataframe like this
> df <- data.frame(int1 = c("A", "B", "Ci"), int2 = c("Ca", "Cg", "A"), value = c(3,6,2))
> df
int1 int2 value
1 A Ca 3
2 B Cg 6
3 Ci A 2
I would like to reorder the values in the first two columns rowwise, searching for a regex or using %in%, such that all the all the values matching "C" are in the same column, and the all the other ones are in another column.
I'm trying to get to this:
C_int other_int value
1 Ca A 3
2 Cg B 6
3 Ci A 2