Searching on stackoverflow questions, I found out this link: Error in file.download when downloading custom file .
However, my case is a little bit different (I thin
I had encountered the same problems on windows or linux server. I believed that this is probably caused by the network speed. I tried to install this package for the second or even the third time (using the function install.packages) or manually download the desired package from CRAN and then installed it and that fixed the problem.
For reference:
I am running Windows Vista, and am getting the same error for various package installs (where the download size is reported to not equal the reported length despite the numbers displayed being equal). The packages appear to install correctly, despite the reported error.
RStudio version 0.98.1091
> SysInfo()
release Vista x64
version build 6002, Service Pack 2
> version
platform x86_64-w64-mingw32
version.string R version 3.1.2 (2014-10-31)
My guess (without any knowledge of the internals of the install.packages
code) is that while integers are being reported, they are not being compared as integers, and so throwing the error.
I solved my problem by going to this site and downloading the required package. The problem of different lengths was due to the inability to download the folder completely from R so I did download it directly and call it from the install button in Packages and selecting zip file rather than CRAN. Then just select the folder and that was for me the solution.