Seems like these kind of checks could be fairly easily bundled into a package. Does this functionality already exist (in devtools
or elsewhere)?
I imagine something like
reprod_check <- check_reprod('myscript.R')
That would return lines containing undeclared variables, setwd()
calls, etc.
I suppose the alternative is to just encourage researchers to bundle their code into packages to accompany publications, thereby addressing the documentation issues, calls to libraries, etc. but that might be an unrealistic ask…