Error:
Error in left_join():
! Can't join x$atc_code with y$atc_code due to incompatible types.
ℹ x$atc_code is a .
ℹ y$atc_code is a .
Possible reason:
|
antimicrobials <- antimicrobials %>% |
|
mutate(ab_days = as.integer(ab_stop_date - ab_start_date), |
|
ab_timing = as.integer(ab_start_date - adm_start_date), |
|
ddd_per_prescription = ddd_per_day*ab_days) %>% |
|
left_join( |
|
AMR::antibiotics %>% |
|
select( |
|
atc_code = atc, ab_type = name, ab_group = atc_group2 |
|
), by = "atc_code") %>% |
typeof(AMR::antibiotics$atc)
[1] "list"
Error:
Possible reason: