Search code examples
rinstallationpackageraster

Issue with installing R package on R studio


I work on Rstudio and my version() result is:

> version
               _                           
platform       x86_64-w64-mingw32          
arch           x86_64                      
os             mingw32                     
system         x86_64, mingw32             
status                                     
major          3                           
minor          3.1                         
year           2016                        
month          06                          
day            21                          
svn rev        70800                       
language       R                           
version.string R version 3.3.1 (2016-06-21)
nickname       Bug in Your Hair

I downloaded the latest version this morning from the web to have the last update. On this, I can not install the package "raster":

> install.packages('raster')
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/florent/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘raster’ is not available (for R version 3.3.1)

I have checked many help online but I can´t find the solution. I did an update of R (to 4.0.2) with which this raster package is working.

Anyone has a solution for this? It begins to be tricky...

Thanks!


Solution

  • It appears that you updated RStudio, but not R. RStudio is a program to make it easier to use R. So what you need to do is install the current version of R. As you can see from your version, you are using a version from 2016. That is ancient in the R world.

    In RStudio you can look under Tools / Global Options / General / R version and perhaps change the R version if multiple versions are available.