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.