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 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.