Skip to content

Commit 1843f9d

Browse files
lobanovavCopilot
andauthored
Potential fix for pull request finding
Fixing R_USER_CACHE_DIR in read-only scenario Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent e8675af commit 1843f9d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

R/Trajectory_CellTypes_v12.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ Trajectory_CellTypes <- function(Seurat_Object,
6060
Sys.setenv(R_USER_CACHE_DIR = cache_original)
6161
}
6262
}, add = TRUE)
63-
Sys.setenv(R_USER_CACHE_DIR = Sys.glob(file.path(R.home())))
63+
cache_dir <- tools::R_user_dir("Trajectory_CellTypes", which = "cache")
64+
dir.create(cache_dir, recursive = TRUE, showWarnings = FALSE)
65+
Sys.setenv(R_USER_CACHE_DIR = cache_dir)
6466

6567
if (!is.null(rownames(MetaData)) && all(colnames(seurat_object) %in% rownames(MetaData))) {
6668
MetaData <- MetaData[colnames(seurat_object), , drop = FALSE]

0 commit comments

Comments
 (0)