I tried to install package data.table in R. This error showed up. Could anyone resolve this?
Asked
Active
Viewed 4.6k times
2 Answers
37
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.

Hong Ooi
- 56,353
- 13
- 134
- 187
-
17Restarted R and the problem persists – Lucio Carlos Pimentel Paiva Mar 05 '18 at 10:39
-
I have found that it sometimes help to close out of a project and then try again. – Jeffrey Girard Jun 28 '19 at 15:59
-
3My experience: 1. close all projects using R, including RStudio projects; 2. restart R and then run install.packages("data.table") again. – Huanfa Chen Aug 08 '19 at 17:55
-
Ensure that the R session is the only open session often helps even if you have not loaded the library (including processes like R language server in vscode) – leo Feb 12 '21 at 18:05
3
Try running R with admin access (sudo in Linux, or for Windows, right click and choose "Run as Administrator"). I had the same problem when running R from PowerShell in Windows, and this fixed it.

Eric
- 297
- 3
- 7