Description Usage Details See Also Examples
env.clear_objects
1 | env.clear_objects(keep_pat = NULL, drop_pat = NULL)
|
Working in an environment or in an app can mean the workspace or in-memory storage can get bogged down with unecessary data objects. This can impact speed or simply clutter the space itself. This function will remove all objects that are not functions in the current environment.
Other Environment utilities: env.clear_console
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # From a working environment
> sapply(ls(), function(i){
is.function(get(i))
}) %>% {
dput(names(.[!.]))
}
[1] "nf" "nf.raw" "nf.team_df" "nf.team_df_master" "nf.teams"
# Now clear anything beginning with nf followed by a dot and has a word after
# such as nf.team_df
> env.clear_objects(drop_pat = "nf\\.(\\w+)+$")
> sapply(ls(), function(i){
is.function(get(i))
}) %>% {
(names(.[!.]))
}
[1] "nf"
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.