nvim-r setting r-path wrongly and nvimcom install fail

232 views
Skip to first unread message

spg...@gmail.com

unread,
Sep 18, 2017, 5:11:38 PM9/18/17
to Nvim-R
Hi, I've just updated my R installation from 3.2.2 to 3.4.1 and at the same time upgraded to vim 80.586 and nvim-R 0.9.10

1) When I start vim :echo $PATH produces the correct path to my new R installation (including C:\Program Files\R\R-3.4.1\bin\x64) but if I load an r script the path gets prepended with the path of the old R installation (C:\Program Files\R\R-3.2.2\bin\x64). I have searched high and low to try to find where the 3.2.2 path information may be coming from (registry, environment variables, grepped all files) but no luck.

2) Then, on typing \rf the nvimcom installation fails with the message:

Error detected while processing C:\Program Files (x86)\Vim\_vimrc:
line 10:
E121: Undefined variable: C
E15: Invalid expression: C:/Program Files/R/R-3.4.1/bin/x64
"~\latex\work\OSID\OneSample_jags.R" 79L, 3239C
Failed to install nvimcom
Nvim-R is incompatible with Rtools 3.4 (August 2016). Please, try Rtools 3.3.

_vimrc does not contain an expression 'C:/Program Files/R/R-3.4.1/bin/x64' so I can't see where that is coming from either.

Possibly 1) and 2) are related but can you make any suggestions how to fix? Of course I could try reverting to RTools 3.3 but I'm not sure if this is the issue. I have another machine set up in the same way and it seems to work just fine.

Thanks, Steve

Jakson Alves de Aquino

unread,
Sep 18, 2017, 5:40:39 PM9/18/17
to Nvim-R
The message says that the error is located at C:\Program Files (x86)\Vim\_vimrc
Perhaps you have accidentally replaced the default vimrc with another one.

spg...@gmail.com

unread,
Sep 19, 2017, 9:29:08 AM9/19/17
to Nvim-R
Hi Jakson, thanks for your reply. The problem is that the _vimrc file does not contain the reported line. Below is _vimrc. It sources vimrc_example.vim and mswin.vim. I've followed the sourcing chain through those files and can't find any reference to 'C:/Program Files/R/R-3.4.1/bin/x64' so I think it might be coming from the system path.

Perhaps 2) is the result of 1) but where in the process of loading an .r file does the path get prepended with 'C:\Program Files\R\R-3.2.2\bin\x64'? And where does this old installation path get picked-up from?

BW, Steve

set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set diffexpr=MyDiff()
function MyDiff()
  let opt = '-a --binary '
  if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  let arg1 = v:fname_in
  if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  let arg2 = v:fname_new
  if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  let arg3 = v:fname_out
  if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  let eq = ''
  if $VIMRUNTIME =~ ' '
    if &sh =~ '\<cmd'
      let cmd = '""' . $VIMRUNTIME . '\diff"'
      let eq = '"'
    else
      let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
    endif
  else
    let cmd = $VIMRUNTIME . '\diff'
  endif
  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction

Jakson Alves de Aquino

unread,
Sep 19, 2017, 10:15:38 AM9/19/17
to Nvim-R
Nvim-R gets the R path from the Windows registry.

spg...@gmail.com

unread,
Sep 19, 2017, 4:29:07 PM9/19/17
to Nvim-R
OK, so the registry had R_HOME and R_path set to the correct R version but nvim-r was finding a key under software/wow6432/R-Core that was still pointing to version 3.2.2 so I just edited the values there. It still fell over on error 2) and installing RTools3.3 sorted it, thanks!

Slightly odd though that it all seems to work fine with RTools3.4 on another machine.

Steve

Jakson Alves de Aquino

unread,
Sep 20, 2017, 8:53:02 PM9/20/17
to Nvim-R
It looks like that it matters whether the system (or R) is either 32 or 64 bit, but I never use Windows. I only reboot my computer on Windows to test whether new changes in Nvim-R developed on Linux also work on Windows. So, I need that someone that uses Windows regularly figure out hot to fix the issue with Rtools.

spg...@gmail.com

unread,
Sep 22, 2017, 4:21:57 AM9/22/17
to Nvim-R
I'll have a play with it and report back if I can find anything.
Reply all
Reply to author
Forward
0 new messages