VISIT for both disc and f06 = "48". Every entry is 48, I combed through myself to double check. I don't know why it's reading as a character for one and a double for the other.
left_join(disc,f06, by=NULL, copy = TRUE, suffix = c(".x", ".y"), na_matches)
Joining, by = c("WIHSID", "VISIT", "ESTAT", "VERSION")
Error: Can't join on `x$VISIT` x `y$VISIT` because of incompatible types.
ℹ `x$VISIT` is of type <double>>.
ℹ `y$VISIT` is of type <character>>.
Run `rlang::last_error()` to see where the error occurred.
unfortunately I can not tell you why one is character and the other is not. but we should be able to work arround that by making x$VISIT a character:
library(dplyr)
disc %>%
mutate(VISIT = as.character(VISIT)) %>%
left_join(f06, by=NULL, copy = TRUE, suffix = c(".x", ".y"), na_matches)
Let me know if that works?!
I recomend you to fill out the "by=" part with the desired columns as that would be more error proof as you data might end up getting extra columns so the automatic detection might get something wrong. Also you have to be sure you want to actually join by all these 4 columns
disc %>%
mutate(VISIT = as.character(VISIT)) %>%
left_join(f06, by=c("WIHSID", "VISIT", "ESTAT", "VERSION"), copy = TRUE, suffix = c(".x", ".y"), na_matches)