Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

target module_aglu_LB141.ag_Fert_IFA_ctry_crop failed #1258

Open
Caiqn23 opened this issue Oct 19, 2024 · 1 comment
Open

target module_aglu_LB141.ag_Fert_IFA_ctry_crop failed #1258

Caiqn23 opened this issue Oct 19, 2024 · 1 comment

Comments

@Caiqn23
Copy link

Caiqn23 commented Oct 19, 2024

when I'm run "dirver_drake()", it remind me that:

✖ fail module_aglu_LB141.ag_Fert_IFA_ctry_crop
: target module_aglu_LB141.ag_Fert_IFA_ctry_crop failed.
diagnose(module_aglu_LB141.ag_Fert_IFA_ctry_crop)$error$message:
... must be empty.
diagnose(module_aglu_LB141.ag_Fert_IFA_ctry_crop)$error$calls:
gcamdata:::module_aglu_LB141.ag_Fert_IFA_ctry_crop("MAKE", c(aglu.FAO.FAO_ag_items_PRODSTAT,
common.iso_GCAM_regID, aglu.AGLU_ctry, L100.LDS_ag_HA_ha,
L100.FAO_ag_HA_ha, aglu.IFA2002_Fert_ktN, aglu.IFA_Fert_ktN))
L100.LDS_ag_HA_ha %>% left_join(FAO_ag_items_PRODSTAT[c("item",
"GTAP_crop")], by = "GTAP_crop") %>% drop_na() %>% group_by(iso,
item) %>% summarise(LDS = sum(value)) %>% ungroup() %>% left_join(L141.FAO,
by = c("iso", "item")) %>% replace_na(list(FAO = 0)) %>%
mutate(scaler = pmin(aglu.MAX_FAO_LDS_SCALER, FAO/LDS)) %>%
left_join(FAO_ag_items_PRODSTAT[c("item", "GTAP_crop")],
by = "item", ignore_columns = "item") %>% select(iso,
GTAP_crop, scaler)
select(., iso, GTAP_crop, scaler)
left_join(., FAO_ag_items_PROD

what should I solve this problem?

@pkyle
Copy link
Contributor

pkyle commented Oct 19, 2024

This error is in 6.0, not 7.0 or the current release version; basically the issue is that the ignore_columns argument applies to the gcamdata function left_join_error_no_match but not to the dplyr function left_join. For a number of years this was not an issue, but within the last two years (after the gcam-v6.0 release) the dplyr developers tightened up their rules on that sort of thing. Anyway I think if you just delete the string , ignore_columns = "item" that should solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants