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 think):
1) I get this annoying warning when installing some packages from CRAN (or also just some dependencies that get generally installed together with the required package).
2) The downloaded length always appear to be equal to the reported length, so there should be no warning.
As an example, I copy-paste here the warning that has just appeared in updating mgcv
.
Warning message:
In download.file(url, destfile, method, mode = "wb", ...) :
downloaded length 1886962 != reported length 1886962
The mode
argument is already set to "wb", so the solution offered in the SO link does not seem to work.
It is very strange, because I have re-installed both R and RStudio recently for other reasons, but this warning has not desappeared.
Any advise is welcome.