I have these datasets:
data_a <- data.frame(label = c("A","B","C","D"))
data_b <- data.frame(lobel = c("C","D","B","A"),
parsu = c("TR","TR","TD","TD"))
And I want data_a to match the group parsu keeping the row order of data_a so the expected result is:
label parsu
A TD
B TD
C TR
D TR
What I have tried is:
data_a %>% left_join(data_b, by = c("label","lobel"))
But I get this error message:
Error: Join columns must be present in data.
x Problem with `lobel`.
Please, could you help me with this question? What is the reason that I can't join those two data frames?