From a14f3ede44a719c886148d80bf8af945cca02813 Mon Sep 17 00:00:00 2001 From: Charlie Gao <53399081+shikokuchuo@users.noreply.github.com> Date: Tue, 25 Feb 2025 09:23:35 +0000 Subject: [PATCH] Faster check for whether a package is on disk (#1777) --- R/session.R | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/R/session.R b/R/session.R index 830746c1d..af4501560 100644 --- a/R/session.R +++ b/R/session.R @@ -101,10 +101,7 @@ detect_installed <- function(info) { } is_on_disk <- function(pkg) { - # A warning is emitted if the package was removed from disk - suppressWarnings( - nzchar(system.file(package = pkg)) - ) + any(file.exists(file.path(.libPaths(), pkg))) } pkg_version_info <- function(pkg,