pkgr
pkgr copied to clipboard
`pkgr inspect` on a New Windows Installation Fails
I just ran the following on Windows as a first test, and it couldn't detect R:
C:\Users\Bill Denney>pkgr inspect
FATA[0000] error getting R version info
R is there in C:\Program Files\R\R-3.6.1
2 questions:
- do you have R in your path
- whats you're pkgr.yml look like?
pkgr will, by default, try to launch R by just invoking essentially R.exe --version
from the shell and then parses the version info returned. If its not in your path, that will fail.
If you don't have it in your path you can still define it in your pkgr.yml as RPath: path/to/R or as a flag --rpath path/to/R.exe
so you might try
pkgr plan --rpath "C:\Program Files\R\R-3.6.1\R.exe"
As an aside, --rpath
is not documented when you just type pkgr
at the command prompt. (And, it doesn't seem to work when I try it with an "unknown flag" error.)
In the end, what I didn't find was that I needed to provide the RPath setting to my yml file. The helpful change here would be to indicate how to provide the R version to pkgr
when it is not obvious. An error message like the following would help:
"Error getting R version. Please either put R on your PATH or give the setting RPath in your yml file."
And, as a check prior to checking the R version, it would help to check if the file that you're looking for exists so that a more specific error could be given. Rather than indicating the version could not be found, indicate the R executable could not be found.
Hi, just want to give my perspective. I also had this problem, and the rpath
solutions don't work. As you can see I tried specifying as a flag, to no avail. You can also see that I actually saved the rpath
into the pkgr.yml
file to no avail.
I also tried switching the /
back to \
(the stupid windows way), but that doesn't work either, it complains of an unknown escape character:
The only solution that worked was to add R to my path in env. variables
For me it helped to add bin in the rpath on line 4 in the pkgr.yml file:
"RPath: "C:/Program Files/R/R-4.0.2/bin/R.exe"".
@DataStrategist sorry for the... extremely delayed response. I'm not completely sure how I missed this. To close the loop on this, your error is different than above, the "found unknown escape" indicates the issue was a parsing error due to the CRLF compared to allt he other LF in the screenshot I'm guessing there was a funky copy-paste error for that. That should resolve if you update that.