Removes stale lock directories that can prevent package installation.
Lock files are created during package installation and should be automatically
removed when installation completes. If installation is interrupted (e.g., by
closing R or a crash), these lock files may remain and block future installations.
Usage
clean_lock_files(package = "ggpubr", lib = .libPaths()[1], ask = TRUE)
Arguments
- package
Character string specifying which package lock to remove.
Default is "ggpubr". Use "all" to remove all lock files.
- lib
Library path to check. Default is the first library in .libPaths().
- ask
Logical. If TRUE (default), asks for confirmation before removing.
Value
Invisibly returns TRUE if files were removed, FALSE otherwise.
Examples
if (FALSE) { # \dontrun{
# Remove ggpubr lock file
clean_lock_files()
# Remove all lock files
clean_lock_files("all")
# Remove without confirmation
clean_lock_files(ask = FALSE)
} # }