Issue with installing R package on R studio - r

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!

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.

Related

R installation for Gurobi 9.1.2 does not work with R 4.0.4

As stated in the question: the installation which worked fine in the past seems to be broken. Any ideas how to solve this issue?
There has been a similar issue in the past, but I am not sure, if it is a similar problem. Although the output only states a warning, the installation does not succeed.
See also here
Details
R.version
_ platform x86_64-w64-mingw32 arch x86_64 os mingw32 system x86_64, mingw32 status major 4 minor 0.4 year 2021 month 02 day 15 svn rev
80002 language R version.string R version 4.0.4 (2021-02-15) nickname
Lost Library Book
install.packages("C:/gurobi912/win64/R/gurobi_9.1-2")
Warning in install.packages : package
‘C:/gurobi912/win64/R/gurobi_9.1-2’ is not available for this version
of R
A version of this package for your version of R might be available
elsewhere, see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
When installing the R package for Gurobi, you need to set repos=NULL as #MrFlick already noted in the comments and as is listed in the official Gurobi installation guide for R: https://www.gurobi.com/documentation/9.1/quickstart_windows/r_ins_the_r_package.html

Error installed R library with version 3.6.0 when only version 3.4 is required

I´m trying to install the library ssev: https://cran.r-project.org/web/packages/ssev/index.html
On a machine with R 3.6.0
install.packages("ssev")
And I´m getting the following error:
“unable to access index for repository http://cran.rstudio.com/src/contrib:
cannot open URL 'http://cran.rstudio.com/src/contrib/PACKAGES'”
Warning message:
“package ‘ssev’ is not available (for R version 3.6.0)”
What I do not understand is why I´m getting this error, when the requiered version for this library is 3.4, as shown in CRAN:
The installation does work with a more recent versions of R like 3.6.3, but in the machine I need it I do not have the option to install a newer version.
I'm using R version 3.6.1 and only getting a warning about the using the library. Generally, you can ignore these and it will still work. If it's not, try updating the package and post the results of trying to load the library and also run version to show info on your setup as I did below:
> library(ssev)
Warning messages:
1: In recycle.data(data, FALSE, length(x), units) :
reached elapsed time limit
2: package ‘ssev’ was built under R version 3.6.3
> version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 6.1
year 2019
month 07
day 05
svn rev 76782
language R
version.string R version 3.6.1 (2019-07-05)
nickname Action of the Toes

Unable to get lastest version of Stringr, knitr, Rmarkdown

R.version
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 3.2
year 2016
month 10
day 31
svn rev 71607
language R
version.string R version 3.3.2 (2016-10-31)
nickname Sincere Pumpkin Patch
Error message:
Rendering R Markdown documents
Required package versions could not be found:
stringr 1.2.0 is required but 1.1.0 is available
knitr 1.18 is required but 1.14 is available
rmarkdown 1.10 is required but 1.1 is available
Check that getOption("repos") refers to a CRAN repository
that contains the needed package versions.
Operating system:
Windows 10 home premium
Issue and Question:
I have installed the newest edition of the free version of RStudio and seem to be having trouble rendering HTML documents from .Rmd files. It appears that I need a newer version of stringr, knitr and rmarkdown however when I try to update.packages it says, "Packages are up to date". I check the repos and it has CRAN and CRANextra for repos and also tried to install packages via install.packages. Does anyone know how to fix this issue?

Unable to install catboost in R

I'm facing trouble downloading catboost in R.
Kindly help to resolve this issue,
> install.packages('catboost')
Installing package into ‘C:/Users/Rishabh Ojha/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘catboost’ is not available (for R version 3.5.2)
My version is as follows:
> version
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 5.2
year 2018
month 12
day 20
svn rev 75870
language R
version.string R version 3.5.2 (2018-12-20)
nickname Eggshell Igloo
The error is pretty self-explanatory. catboost is not available from CRAN (but see e.g. here for a discussion).
You can however install catboost if you follow the installation guide available from the catboost GitHub project site. Specifically, the installation instructions for installing catboost on a Windows machine can be found on Install from a local copy on Windows.
From the latter link:
It is strongly recommended to install the released version. Try it if other installation methods result in errors.
Windows installation currently requires Visual C++ 2017 Build Tools.
Training on GPU requires NVIDIA Driver of version 390.xx or higher.
It's probably also worth taking a look at the project's GitHub issues, e.g. Building and installing problem in R. Good luck.

Why can't I install the XML package

Am I making some basic error here?
install.packages("XML")
Warning in install.packages :
package ‘XML’ is not available (for R version 2.13.0)
Installing package(s) into ‘C:/Program Files/R/R-2.13.0/library’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘XML’ is not available (for R version 2.13.0)
It is probably because www.omegahat.org doesn't exist anymore. So,
command install.packages("XML", repos = "http://www.omegahat.org/R")
does not work. Instead use below:
install.packages("XML", repos = "http://www.omegahat.net/R")
There can be two conditions when you see such error:
The package does not exist in the library (you should install it
from it's own library)
The package is not compatible with your R
version (you should change your R version that is compatible, if you
can afford it)
For the first condition, search on internet and read about the package you want to install and check the provider and repository (for this case, XML, it is official R package)
For the second condition, you can find the information in the following link:
http://cran.r-project.org/web/packages/XML/index.html
you can check your R version by typing the following command into your R shell:
version
which will give you all the information, for e.g:
_
platform x86_64-apple-darwin10.8.0
arch x86_64
os darwin10.8.0
system x86_64, darwin10.8.0
status
major 3
minor 0.1
year 2013
month 05
day 16
svn rev 62743
language R
version.string R version 3.0.1 (2013-05-16)
nickname Good Sport
First update the R-core:
version
install.package('installr')
library(installr)
updateR()
Then install the XML module:
install.packages("XML")
What worked for me is downloading the old release of the XML package and installing from the package archive
install.packages("~/R/win-library/3.6/XML_3.99-0.3.zip", repos = NULL, type = "win.binary").

Resources