Warning message: 'c:/Rtools/mingw_/bin/g++' not found - r

When I try to use RStan (which needs RTools to run) in R, I get the following warning message:
Warning message: In system(paste(CXX, ARGS), ignore.stdout = TRUE,
ignore.stderr = TRUE) : 'c:/Rtools/mingw_/bin/g++' not found
But, when I check in the 'c:/Rtools/' folder, I find two 'mingw_' files, called 'mingw_32' and 'min_gw64', and in both folders there is already a 'bin/g++' file. Why do I get this warning then? Is it wrong to have two folders, one 32 and one 64 bits?

delete your old .Rprofile and try again. This helped in my case

Related

Error in install_github: System command 'Rcmd.exe' failed, exit status: 1, stdout & stderr were printed

I was trying to install the package "pgenlibr" in the github, using the command
install_github("chrchang/plink-ng", subdir="/2.0/pgenlibr"), and received the error message.
> install_github("chrchang/plink-ng", subdir="/2.0/pgenlibr")
Downloading GitHub repo chrchang/plink-ng#HEAD
√ checking for file 'C:\Users\86137\AppData\Local\Temp\RtmpILEuSP\remotes109044a8685a\chrchang-plink-ng-73bdbc3\2.0\pgenlibr/DESCRIPTION' ...
Warning in file.copy(pkgname, Tdir, recursive = TRUE, copy.date = TRUE) :
problem copying .\pgenlibr\src\include to C:\Users\86137\AppData\Local\Temp\RtmpaONA8h\Rbuild2e1c6cc05dce\pgenlibr\src\include: Permission denied
Warning in file.copy(pkgname, Tdir, recursive = TRUE, copy.date = TRUE) :
problem copying .\pgenlibr\src\libdeflate to C:\Users\86137\AppData\Local\Temp\RtmpaONA8h\Rbuild2e1c6cc05dce\pgenlibr\src\libdeflate: Permission denied
Warning in file.copy(pkgname, Tdir, recursive = TRUE, copy.date = TRUE) :
problem copying .\pgenlibr\src\zstd to C:\Users\86137\AppData\Local\Temp\RtmpaONA8h\Rbuild2e1c6cc05dce\pgenlibr\src\zstd: Permission denied
ERROR
copying to build directory failed
Error: Failed to install 'pgenlibr' from GitHub:
System command 'Rcmd.exe' failed, exit status: 1, stdout & stderr were printed
I have installed its required software listed on Readme, Rtools, all packages dependencies. I have also tried other methods, delete all Rtmp files, run Rstudio as administrator, cancel "read only" to folder "temp" and "library" in the workpath, but gained no success.
In addition, I'm using Windows 10.
How can I solve this problem?
I have solve this problem on Ubuntu System.
There is a similar problem when installing 'cindex', Here is the a link.
So the reason seems to be that install_github( ) in Win10 can not deal with symlink very well.
I got the same error when I was building the source for an R package and there was a syntax error in the DESCRIPTION file.
To solve, I removed suspected culprits from the DESCRIPTION file and it worked, so then just narrowed down to isolate the offending line (it was a typo in the person() function in my case, but causes my vary).

Permission denied when manually installing R package

Hi I am currently run R code with version 4.1.0 on ubuntu(WSL) right now. I try to install some R packages manually because my internet is too slow, but I cannot get permission, the warning messages suggest the probable reason "permission denied". Here is the error and warning messages.
Warning in dir.create(path, showWarnings = TRUE, recursive = TRUE, ...) :
cannot create dir 'Rhdf5lib_1.14.2/Rhdf5lib', reason 'Permission denied'
Error in mydir.create(name) :
failed to create directory ‘Rhdf5lib_1.14.2/Rhdf5lib’
I really hope someone can help me with this problem, thanks a lot!
Try to start your R session with sudo R. Other possible option is to specify a lib argument like install.packages("SomePackage", lib = "/home/user/R/...")
I try the following command
export PATH=$PATH: path/to/your/R
and run R directly,this works for me.

Unable to update R

I have 4.0.2 version and I want to update it. So I install installr and I tried to use updateR():
install.packages("installr")
library(installr)
updateR()
After library(installr) I got a warning message:
Installation status: FALSE . Removing the file:
C:\Users\HP250~1\AppData\Local\Temp\Rtmp2RQ7lv/R-4.0.3-win.exe (In
the future, you may keep the file by setting keep_install_file=TRUE)
[1] FALSE
Warning messages:
1: In download_fun(exe_URL, destfile = exe_filename, quiet = FALSE, :
downloaded length 20258816 != reported length 88237960
2: In shell(install_cmd, wait = wait, ...) : > 'C:\Users\HP250~1\AppData\Local\Temp\Rtmp2RQ7lv/R-4.0.3-win.exe' execution failed with error code 1
but I continue with updateR(). Then it started loading but aftrer fe seconds (at 10-20%) stopped. I got an other warning message:
The setup files are corrupted. Please obtain a new copy of the
program.
What is the problem? How can I fix it?
Thanks in advance!
I deleted Temporary Files and problem solved. I don't know why, but everything is ok now.

One error when I run my R code about .stan file

I execute a code in R as following
model <- rstan::stan_model('ex_05_13.stan')
But there is an error as following:
Error in compileCode(f, code, language = language, verbose = verbose) : sh: c:/rtools40/mingw64/bin/g++: No such file or directorymake: *** [C:/PROGRA~1/R/R-40~1.2/etc/x64/Makeconf:229: file492c7acd69ff.o] Error 127
In addition: Warning message:
In system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) : '-E' not found Error in sink(type = "output") : invalid connection
My ex_05_13.stan is syntactically correct. I don`t know why I cannot run my ".stan"? Thank you.
Face similar problem... Looks like a folder had previously made so the new R Tools cannot be installed and run the program properly

RStudio v1.1.456 Rpubs upload error, no login prompt

Hi I couldn't find any useful information in regards to this one.
When I try to publish to Rpubs on Rstudio v1.1.456, instead of login prompt I get this error message below.
[Edited] Rstudio v1.1.456, R v3.5.1
Upload Error Occurred Error in if (result$status == 201) succeeded <-
TRUE : missing value where TRUE/FALSE needed Calls: In
addition: Warning message: In http(protocol, "api.rpubs.com", port,
method, path, headers, : NAs introduced by coercion Execution
halted
I've already addded this line
options(rpubs.upload.method = "internal")
to both global and working directory Rprofile
Apparently, there was an issue in the most recent version of rsconnect (0.8.12).
devtools::install_github("rstudio/rsconnect", ref = "bugfix/multi-status-header")
Installing the patch solves it.

Resources