Conversation
| ) { | ||
|
|
||
| # save for plt_add() | ||
| options(tinyplot_last_call = match.call(tinyplot, |
Owner
To be consistent with the rest of the package infrastructure, let's rather save this to the existing .tinyplot_env. This is what we use in R/get_saved_par.R, for an example:
| #' @export | |
| get_saved_par = function(when = c("before", "after")) { | |
| when = match.arg(when) | |
| par_env_name = paste0(".saved_par_", when) | |
| return(get(par_env_name, envir = get(".tinyplot_env", envir = parent.env(environment())))) | |
| } | |
| # (non-exported) companion function(s) for setting the original pars | |
| set_saved_par = function(when = c("before", "after"), value) { | |
| when = match.arg(when) | |
| par_env_name = paste0(".saved_par_", when) | |
| assign(par_env_name, value, envir = get(".tinyplot_env", envir = parent.env(environment()))) | |
| } |
We'll need to assign NULL values to this call object at startup in R/zzz.R too, e.g.
| assign(".saved_par_after", NULL, envir = get(".tinyplot_env", envir = parent.env(environment()))) |
Merged
Labels
None yet