user3395158's solution worked for me. I had a similar problem with rstudioapi. I'd recommend trying RStudio. It has a built in interface for downloading packages directly from CRAN to the directory of your choice.
If you're using RStudio you can go to the "Tools" menu, then "Install Packages...", then select repository under the "Install from:" drop-down. Type in your package name below "Packages", like I did in my screenshot. Then you specify the directory to install the package, under the "Install to Library" drop-down. Meaning you should have ‘C:\Users\Xiang\Documents\R\win-library\3.2\’ in the box, instead of my directory.
Hope that helps some!
