Skip to main content
100%

Unload R packages that override certain tidyverse functions (scran, scater) if they appear in search()

✓ Published0🌍 Public
FFloWuenne
Last edited Jun 7, 2017
Created on Jun 7, 2017

This example demonstrates how to resolve function conflicts when loading single-cell R packages alongside the tidyverse. It shows a defensive code snippet that checks whether the `scran` or `scater` packages are present in the search path using `search()`, and if so, forcibly unloads them with `detach(..., unload=TRUE)` to prevent their functions from overriding tidyverse verbs like `mutate` or `arrange`. The approach relies on base R functions, specifically `search()`, `%in%`, and `detach()`, to conditionally remove packages at runtime. The visualization highlights a practical workflow safeguard, using the `gistfile1.txt` source as the basis for the code logic.

AI-generated description

Similar vizzes