I assume the download might be corrupted? But I tried several times.
Yes. Downloading may result in damage, or according to this thread in the R help mailing list, the problem may be caused by a damaged package on the server itself. In the latter case, it can be solved by choosing another mirror to download the package.
NOTE I will describe a solution that uses the R console instead of the Rstudio GUI because I used the packages in this way. Perhaps the described approach can work with package installations from the graphical interface.
When you install the package from the R console by doing:
> install.packages("<package_name>")
You are offered a list of available mirrors to choose from:
1: 0-Cloud [https] 2: Austria [https] 3: Chile [https] 4: China (Beijing 4) [https] ...
Just choose another one (preferably near your location to have a faster download).
If you are not given this choice, but the download starts immediately, you have a default mirror configured (for example, Rstudio automatically sets https://cran.rstudio.com/ as the default value). You can check the selected mirror by issuing:
> getOption("repos")["CRAN"] CRAN "https://cran.rstudio.com/"
In the reset mirror, you can use the following commands:
> r <- getOption("repos") > r["CRAN"] <- "@ CRAN@ " > options(repos=r)
Now, when you try to install a new package, you can choose another mirror, as described above.
Yaroslav admin
source share