Cannot install r studio code#
This may sound obvious, but it’s very easy to overlook, and sometimes you can be so caught up in writing code that you didn’t notice the one-hour WiFi at the coffee shop has expired and that you’re no longer connected. Check your networkĪfter verifying the package spelling is correct, the next thing I do is make sure I have internet connection. Protip: using copy-paste is a good way to ensure that. Look up the package name and verify you have the correct spelling. This means that capitalization must be correct too! For example, if you run install.packages("Rmarkdown"), it will fail because the package name is “rmarkdown” (lower case). The first thing I do is make sure I spelled the package correctly.
Option 2: Use GitHub’s read-only CRAN mirror.Option 1: Use the source GitHub repository.Make sure the package hasn’t been removed from CRAN
Make sure the package is released on CRAN If you have any more to add, let me know! Table of contents Note: This is not meant to be an exhaustive list of all the reasons a package won’t install, but it should hopefully cover most cases. All it tells us is that your R session thinks the package is unavailable on CRAN, but there can be many reasons why, and each one requires a different solution.īelow are some of the common reasons I’ve run into this error, and they’re listed in chronological order of what I look for when I get the error. Sometimes this message comes at very unexpected times, like when you’re sure that you were able to install this package every day for the past year, so why would it not succeed now? While this message isn’t completely cryptic, it isn’t too helpful either. One of the error messages that almost any R user in history has seen is “package ‘foo’ is not available (for R version x.y.z)”, which would come after trying to install package “foo” from CRAN using install.packages("foo"). The R language is infamous among its users for often having unhelpful error messages.