names of objects to be retained, as names (unquoted) or character strings(quoted).

list

a character vector naming the objects to be retained.

envir

the environment from which the objects are removed that are not to be retained.

force

logical value. As a measure of caution, this function removes objects only from local
environments, unless force equals TRUE. In that case, retain can also be used to
clear the global environment, the user’s workspace.