Error in installing ggplot2

I'm trying to install ggplot2 but get the error message in the console. The message is like that:

Warning in install.packages :
unable to access index for repository http://cran.rstudio.com/src/contrib:
не могу открыть URL 'http://cran.rstudio.com/src/contrib/PACKAGES'
Warning in install.packages :

Warning in install.packages :
package ‘ggplot2’ is not available for this version of R

Have a look at

The error messages are the same.

This seems like a connectivity issue, R is not being able to connect to the CRAN repository you have selected, these are some things to try.

  • Choose a different CRAN repository, RStudios repository is a good choice (http://cran.rstudio.com/) or you could choose one that is geographically closer to you.
  • Disable secure download setting.
  • Check if your internet connection has traffic restrictions of some kind, like a firewall, proxy server, etc. This is usually the case when you are at work or school.