I am pretty sure I read somewhere how to do this. Instead of saving the current option (for example, the working directory) to a variable, change wd, perform the operation, and then go back to what it was, doing it inside the function, is akin to "c" regarding attach / detach. Now I only need a solution for the working directory, but maybe a more general function that does such things? Or isnβt it?
So, to illustrate ... As it is now:
curdir <- getwd()
setwd("../some/place")
setwd(curdir)
How this happens in my wildest dreams:
with.dir("../some/place",
I know that I could write a function for this, I have the impression that there is something more accessible and generalized for other parameters.
thank