Hi @Ajii! Welcome!
First of all, I’m assuming that
crab.rstudio.com is just a typo in your message here for
cran.rstudio.com (a URL that auto-redirects you to the closest CRAN mirror). If you really do have
crab in your repository path, you should try changing your default repository in your RStudio Options.
That error message means R is unable to access CRAN over the internet. This often has one of the following causes:
- The computer you were using was not connected to the internet when you tried to install packages
- You are behind a proxy or firewall that is not allowing R to connect to the internet
- Your network (or your internet service provider) is running web filtering software that is not allowing connections to CRAN sites
If you search for the error message here, you’ll find lots of previous discussions that might be helpful: https://community.rstudio.com/search?q=unable%20to%20access%20index%20for%20repository
As a note, this is almost always a problem with R, not with the RStudio IDE. See this FAQ if you’re not sure of the difference (a common problem!): Differentiating R from RStudio