LIBNAME mylib CLEAR;detach("package:pkg", unload = TRUE) removes an attached package from the search path and unloads its namespacesearch(); attached packages appear as "package:pkg"tidyverse attach several packages; detach them individually (loop through the tidyverse core packages)