% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/remove_user_installed_packages.R
\name{remove_user_installed_packages}
\alias{remove_user_installed_packages}
\title{Remove User-Installed Packages}
\usage{
remove_user_installed_packages()
}
\value{
Invisibly returns a named list with components: \code{status} ("done" or
"clean") and \code{packages_removed} (character vector).
}
\description{
Identifies and removes all user-installed R packages from the system, 
while carefully preserving base and recommended packages, as well as 
packages installed in specific system libraries (e.g., MRO).
}
\details{
The function performs the following steps:
\enumerate{
  \item Retrieves a list of all installed packages.
  \item Filters out packages located in libraries containing "MRO" to avoid 
      corrupting system-specific installations.
  \item Filters out packages with a priority of "base" or "recommended" to 
      ensure core R functionality remains intact.
  \item Identifies the library paths where the remaining user packages are installed.
  \item Iteratively removes each identified user package using `remove.packages()`.
}
}
\section{Warning}{

This function modifies files on disk or the global environment. Please ensure you have a backup or are using version control (e.g., Git) before execution.
}

\examples{
if (interactive()) {
  remove_user_installed_packages()
}
}
