As an aside, I'm not too sure I understand the need/value of using the leading purrr functions here. i think you'd be better off to just use data.table::set() with lapply and avoid the dependency requirement (+ NSE headache).
lapply(yvars, function (y) {
set(data, j = "zz000adj", value = data[[paste("zz000adj", y, sep = "_")]])
})
Created on 2022-09-03 with reprex v2.0.2
The offending code is here: https://github.com/kylebutts/didimputation/blob/main/R/did_imputation.R#L213-L223 (And a similar issue for lines 247--255 a bit further down.)
A quick and dirty solution is simply to use a more esoteric function argument than "y". Something like:
As an aside, I'm not too sure I understand the need/value of using the leading
purrr
functions here. i think you'd be better off to just usedata.table::set()
withlapply
and avoid the dependency requirement (+ NSE headache).