I had posted a few days earlier about issues in installing packages in RStudio here - RStudio Package installation error. However, my question was marked as duplicate, assuming that the solution posted in the comments is actually the best solution.
Although I have the exact same problem as already mentioned, that solution posted by Ian doesn't help. In fact I get a new kind of error. Please see below:
Warning in install.packages :
unable to connect to 'cran.rstudio.com' on port 80.
Warning in install.packages :
unable to connect to 'cran.rstudio.com' on port 80.
Warning in install.packages :
unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.1
Warning in install.packages :
unable to connect to 'www.stats.ox.ac.uk' on port 80.
Warning in install.packages :
unable to connect to 'www.stats.ox.ac.uk' on port 80.
Warning in install.packages :
unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.1
Installing package into ‘C:/Users/avi/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)