Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repeat last call #41

Open
ggrothendieck opened this issue Aug 20, 2020 · 0 comments
Open

repeat last call #41

ggrothendieck opened this issue Aug 20, 2020 · 0 comments

Comments

@ggrothendieck
Copy link

A feature I would find useful is to repeat the last call without having to pass any parameters.

When debugging if there is a complex setup to generate the parameters possibly done through a gui that runs a function f then it would nice to be able to re-run f without the gui by just running f(), say.

Currently I do this (plus various error check that are not shown):

f <- function(x) {
  if (nargs() == 0) return(do.call("f", .GlobalEnv$.f))
  assign(".f", mget(ls()), .GlobalEnv)
  x+1
}

f(3)
## [1] 4

f() # rerun using last set of arguments
## [1] 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant