Error in Install.Packages:Cannot Remove Prior Installation of Package 'Dbi'

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



Leave a reply



Submit