Question: I am using R 3.4.3 and am unable to install the caret package (`Error in install.packages(caret) : object 'caret' not found)`. I have tried other repositories and CRAN mirrors. I have tried installing github and remotes and devtools with no luck. Any ideas on how I can install this package? I have tried install.packages("caret") with the following error message: Warning in install.packages("caret") :
 'lib = "C:/Program Files/R/R-3.4.3/library"' is not writable
Error in install.packages("caret") : unable to install packages. I have internet connectivity and have tried installing from the menu without luck.

Answer: 
You need " quotes

```
install.packages("caret")

```

and to use it

```
library(caret)

```
Because you missed the quotes around "caret"

```
install.packages("caret") # RIGHT - use a string name
install.packages(caret)   # WRONG - it thinks caret is some string variable containing the name of the actual package

```

---

OLD ANSWER
 - Installing from CRAN from command-line or GUI should work, but if for whatever reason it doesn't (might be your intranet, or connectivity, or network security), you can...
 - Download the tarball (with wget/ browser/ ftp) then proceed as per [Install R Packages without internet](https://stackoverflow.com/questions/10528630/install-r-packages-without-internet)
 - See also [How should I deal with “package 'xxx' is not available (for R version x.y.z)” warning?](https://stackoverflow.com/questions/25721884/how-should-i-deal-with-package-xxx-is-not-available-for-r-version-x-y-z-wa) for fallbacks (compile from source, use older version, etc).