Julio
Julio

Reputation: 318

Error loading a CPP file in RStudio with Microsoft R

I installed Microsoft R Open 3.5.1, tried to load a cpp with Rcpp::sourceCpp('TSDecompositionMissing.cpp') and I'm getting this error:

Error in system(cmd, intern = !showOutput) : 'C:/PROGRA~1/MIE74D~1/R' not found

I added the verbose flag and then I'm seeing:

...
Building shared library
--------------------------------------------------------

DIR: C:/Users/julio/AppData/Local/Temp/RtmpyqXrSJ/sourceCpp-x86_64-w64-mingw32-0.12.18/sourcecpp_88d456ea7b2a

C:/PROGRA~1/MIE74D~1/R Open/R-3.5.1/bin/x64/R CMD SHLIB -o "sourceCpp_4.dll" "" "TSDecompositionMissing.cpp"  
Error in Rcpp::sourceCpp("TSDecompositionMissing.cpp", verbose = T) : 
  Error 127 occurred building shared library.

I checked my Sys.getenv() and I can see two relevant paths that do not exist (at least PROGRA~1 doesn't):

R_DOC_DIR C:/PROGRA~1/MIE74D~1/R Open/R-3.5.1/doc R_HOME C:/PROGRA~1/MIE74D~1/R Open/R-3.5.1

Has somebody encountered this error before?

EDIT:

So, I realised the PATH C:/PROGRA~1/MIE74D~1/ exists and I think the problem is the folder after that which is named "R Open". It does not like the blank space

Upvotes: 0

Views: 187

Answers (1)

Julio
Julio

Reputation: 318

After Hong Ooi suggestion, I uninstalled Rtools 3.4, installed Rtools 3.5, reinstall MRO 3.5, R 3.5 and RStudio and now everything is working. The problem was probably RTools 3.5 was missing.

Upvotes: 1

Related Questions