In a script I need to load packages tydiverse and gdistance.
gdistance actually loads several other packages and overall mask some functions of the tydiverse (e.g. select).
I tried to rearrange the script by loading the gdistance only when needed and having the related lines at the end of the script.
Anyway one of the very last line I need still use the function tydiverse::select, which is then not found and it throws an error.
Is there a way to make a copy of the R environment before loading the gdistance package so that I can then restore the environment as it was before loading the pakage that induce the problem?