Keep only specified objects in the environment, removing all others.
Source:R/General_KeepOnly.R
KeepOnly.Rd
This function selectively retains the objects specified in the Obj
parameter in the current environment, removing all other objects. It is
useful for memory management by clearing unnecessary objects from the
environment. The function also provides an option to print the names of the
kept and removed variables.