I tried this on my Windows 11 machine, and I get gamstransfer installed on R 4.2.2 without a problem. I did this in RStudio:
RStudio 2022.12.0+353 "Elsbeth Geranium" Release (7d165dcfc1b6d300eb247738db2c7076234f6ef0, 2022-12-03) for Windows
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2022.12.0+353 Chrome/102.0.5005.167 Electron/19.1.3 Safari/537.36
Here's the log of the installation, with sessionInfo() also. This sort of output is helpful to anybody (including you) troubleshooting a problem.
> install.packages("C:\\GAMS\\41.5.0\\apifiles\\R\\gamstransfer\\binary\\gamstransfer.zip")
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/sdirk/AppData/Local/R/win-library/4.2’
(as ‘lib’ is unspecified)
inferring 'repos = NULL' from 'pkgs'
package ‘gamstransfer’ successfully unpacked and MD5 sums checked
> sessionInfo()
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22621)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8 LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.2.2 tools_4.2.2
HTH,
-Steve