I have an environment of objects that are either xts or NULL
. I would like to remove all the NULL
from the environment. Is there a function I can use with eapply
to achieve this?
rm(
list=names(
which(
sapply(globalenv(),is.null) # or .GlobalEnv
)
)
)
If it's not the global environment, you can use the envir
switch in rm
and wrap the environment name in getenv()
in the sapply
call