Skip to content

Instantly share code, notes, and snippets.

@FloWuenne
Last active June 7, 2017 15:54
Show Gist options
  • Save FloWuenne/619799903afcf7c0dcf5e796731476c3 to your computer and use it in GitHub Desktop.
Save FloWuenne/619799903afcf7c0dcf5e796731476c3 to your computer and use it in GitHub Desktop.
Unload R packages that override certain tidyverse functions (scran, scater) if they appear in search()
## Been having issues lately when using tidyverse functions such as mutate or arrange
## while having single cell packages such as scran and scater loaded, since they seem to have
## similar functions, that override the tidyverse functions
## Add this snippet to chunks that use tidyverse functions to unload packages that interfere
if(c("package:scran","package::scater") %in% search()){
detach("package:scater", unload=TRUE)
detach("package:scran",unload=TRUE)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment