I run into the following problem: everytime I would like to install the package "class" through renv specific commands, e.g. renv::restore() or renv::install("class@7.3-20"), I get an error message. However, if I run install.packages("class",version="7.3-20") everything works fine.
I start with the renv diagnostics:
> renv::diagnostics()
Diagnostics Report [renv 0.17.3]
================================
# Session Info =======================
R version 4.3.0 (2023-04-21 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)
Matrix products: default
Installing "class" with renv gives the following message
> renv::install("class@7.3-20")
Consider removing these folders from your R library.
Retrieving 'https://cran.rstudio.com/src/contrib/Archive/class/class_7.3-20.tar.gz' ...
OK [file is up to date]
Installing class [7.3-20] ...
FAILED
Error installing package 'class':
=================================
* installing *source* package 'class' ...
** Paket 'class' erfolgreich entpackt und MD5 Summen überprüft
** using staged installation
** libs
using C compiler: 'gcc.exe (GCC) 12.2.0'
gcc -I"C:/PROGRA~1/R/R-43~1.0/include" -DNDEBUG -I"C:\Users\mschleri\AppData\Local/R/cache/R/renv/extsoft/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c class.c -o class.o
class.c:31:9: error: unknown type name 'Sint'; did you mean 'int'?
31 | VR_knn1(Sint *pntr, Sint *pnte, Sint *p, double *train, Sint *class,
| ^~~~
| int
.
.
.
make: *** [C:/PROGRA~1/R/R-43~1.0/etc/x64/Makeconf:265: class.o] Error 1
ERROR: compilation failed for package 'class'
Installing class install.packages("class",version="7.3-20") on the other hands works without problems. Rtools is installed and works fine outside of the renv package. Could it be that renv does not support the current Rtools version (43)? They still have an open issue on github to fix the support of rtools 43 (https://github.com/rstudio/renv/issues/1214).
Thanks for any suggestions and help!
This doesn't have anything to do with Rtools, it's an issue with what you are trying to do.
The install.packages()
function will ignore your version
argument, so you'll get the latest version, 7.3-22. Version 7.3-20 is not compatible with R 4.3.x, because the Sint
and related definitions have been dropped.
So if you want to install 7.3-20, you'll need to use an older version of R.