replace_na broken in tidyr 1.2.0
benmsanderson opened this issue · 1 comments
Building xmls in GCAM data system v5.1 is broken in R v4.1 due to a change in functionality of replace_na for dataframes:
Workaround is downgrading tidyr to version 1.1.4.
GCAM Data System v5.1
Found 354 chunks
Found 3351 chunk data requirements
Found 1911 chunk data products
1118 chunk data input(s) not accounted for
Chunks left: 1472
[1] "module_aglu_LA100.0_LDS_preprocessing"
[1] "- make 3.12"
[1] "module_aglu_LA100.FAO_downscale_ctry"
Error in stop_vctrs()
:
! Can't convert replace$element
to match type of data$element
.
Backtrace:
▆
- └─gcamdata::driver(write_output = FALSE, write_xml = TRUE)
- └─gcamdata::run_chunk(chunk, all_data[input_names]) at gcamdata/R/driver.R:295:6
-
├─base::do.call(chunk, list(driver.MAKE, all_data)) at gcamdata/R/driver.R:16:2
-
└─gcamdata::module_aglu_LA100.FAO_downscale_ctry("MAKE", `<named list>`)
-
├─tidyr::replace_na(FAO_data_ALL, repl) at gcamdata/R/zchunk_LA100.FAO_downscale_ctry.R:274:4
-
└─tidyr:::replace_na.data.frame(FAO_data_ALL, repl)
-
└─vctrs::vec_assign(...)
-
└─vctrs `<fn>`()
-
└─vctrs::vec_default_cast(...)
-
└─vctrs::stop_incompatible_cast(...)
-
└─vctrs::stop_incompatible_type(...)
-
└─vctrs:::stop_incompatible(...)
-
└─vctrs:::stop_vctrs(...)
-
└─rlang::abort(message, class = c(class, "vctrs_error"), ...)
Execution halted
make: *** [Makefile:5: xml] Error 1
Hi @benmsanderson thanks for sharing! This is a known problem that we are hoping to fix by implementing renv for dependency management (#1174)