I have two dataframes Table1 and Table2 with primary keys a and b respectively. a is of class
numeric and b is of class character with the unique values shown below. I need to left join Table1 with Table2 on a = b. What will be the best way to change columns class to make them ready for joining?
Since your Table1$a contains values that can't be expressed in numeric format, I think that the best solution is to transform your Table2$b values from numeric (really: integer) to string. You can do that like this, to get the leading zeros.
Hi, can you provide a reproducible example please ?
see About REPRoducible EXample (reprex)
A reprex makes it much easier for others to understand your issue and figure out how to help.
I don't get the same as you if I try to recreate: a is character and b is numeric