I have two df and I would like to do left_join. But for some reason I can not join them together. Could anyone take a look and see where I did wrong? No error codes just the info from cov are all empty.
df<-structure(list(LBCAT = c("CHEMISTRY", "CHEMISTRY", "CHEMISTRY",
"CHEMISTRY", "CHEMISTRY", "CHEMISTRY"), LBTEST = c("ALANINE AMINOTRANSFERASE",
"ALANINE AMINOTRANSFERASE", "ALANINE AMINOTRANSFERASE", "ALANINE AMINOTRANSFERASE",
"ALANINE AMINOTRANSFERASE", "ALANINE AMINOTRANSFERASE"), lbstresn = c(6,
11, 26, 21, 14, 13), lbstresu = c("U/L", "U/L", "U/L", "U/L",
"U/L", "U/L"), lbstnrlo = c(6, 6, 6, 6, 6, 6), lbstnrhi = c(37,
37, 37, 37, 37, 37)), row.names = c(NA, -6L), class = c("tbl_df",
"tbl", "data.frame"))
cov<-structure(list(LBCAT = c("CHEMISTRY", "CHEMISTRY", "CHEMISTRY",
"CHEMISTRY", "CHEMISTRY", "CHEMISTRY", "CHEMISTRY"), LBTESTCD = c("ALT",
"ALT", "ALT", "ALT", "ALT", "ALT", "ALT"), LBTEST = c("Alanine Aminotransferase",
"Alanine Aminotransferase", "Alanine Aminotransferase", "Alanine Aminotransferase",
"Alanine Aminotransferase", "Alanine Aminotransferase", "Alanine Aminotransferase"
), LBORRESU = c("NKAT/L", "IU/L", "MU/ML", "U/L", "UKAT/L", "MCKAT/L",
"IU/ML"), LBSTRESU = c("ukat/L", "ukat/L", "ukat/L", "ukat/L",
"ukat/L", "ukat/L", "ukat/L"), LBSICF = c(0.001, 0.0167, 0.0167,
0.0167, 1, 1, 16.7)), row.names = c(NA, -7L), class = c("tbl_df",
"tbl", "data.frame"))
test <- left_join(df, cov, by = c('LBCAT'= toupper('LBCAT'), 'LBTEST' = toupper('LBTEST'), 'lbstresu' = toupper('LBORRESU')))
