Warning in install.packages : cannot remove prior installation of package ‘data.table’
I assume you're on Windows. You may have data.table loaded into your session already; on Windows, dlls that are part of a package can't be unloaded until R shuts down. So restart R and then try running install.packages
again.
Addressing the cannot remove prior installation of package error when updating multiple packages at once
One strategy is to do
setdiff(dir(.libPaths()), .packages(all = TRUE))
To get a list of directories in the library that don't seem to actually contain packages. Now I have a much smaller list of packages to reinstall.
I'm not sure if it's foolproof, but it's better than reinstalling my entire library.
Warning in install.packages : cannot remove prior installation of package ‘data.table’
I assume you're on Windows. You may have data.table loaded into your session already; on Windows, dlls that are part of a package can't be unloaded until R shuts down. So restart R and then try running install.packages
again.
install packages in R
Are you looking for this?
if(!requireNamespace("BiocManager", quietly = TRUE)){
install.packages("BiocManager")
}
BiocManager::install(version = "3.11")
See the Bioconductor - install page.
Related Topics
Plot Causes "Error: Incorrect Number of Dimensions"
Vectorize a Product Calculation Which Depends on Previous Elements
Print String and Variable Contents on the Same Line in R
Plot Random Effects from Lmer (Lme4 Package) Using Qqmath or Dotplot: How to Make It Look Fancy
Get the Column Number in R Given the Column Name
Working with Dictionaries/Lists to Get List of Keys
How to Make a Matrix from a List of Vectors in R
Here We Go Again: Append an Element to a List in R
Reorder Rows Using Custom Order
What Is a Good Way to Read Line-By-Line in R
Can't Change Fonts in Ggplot/Geom_Text
Doing a Plyr Operation on Every Row of a Data Frame in R
Exceeding Memory Limit in R (Even with 24Gb Ram)
Ggplot2 Theme with No Axes or Grid
R Reshape a Vector into Multiple Columns