使用 Rcpp 找不到消息错误“C:/Program" [英] Message error 'C:/Program' not found with Rcpp

查看:38
本文介绍了使用 Rcpp 找不到消息错误“C:/Program"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行的是 64 位 Windows 7 平台.

I'm running a 64-bit Windows 7 platform.

我已添加到我安装的程序/库中:

I have added to my installed programs/libraries:

  • Rtools

  • Rtools

R(软件)

Rcpp(R 包)

内联(R 包)

我尝试了在此处

## now with Rcpp and C++
library(inline)
# and define our version in C++
src <- "int n = as<int>(ns);
double x = as<double>(xs);
for (int i=0; i<n; i++) x=1/(1+x);
return wrap(x); "
l <- cxxfunction(signature(ns="integer", xs="numeric"),
body=src, plugin="Rcpp")

但这不起作用(老实说这并不奇怪,因为我什至没有指定例如 Rtools 的位置).我收到以下错误消息:

But that doesn't work (That is not a surprise to be honest as I even didn't specified eg the location of Rtools). I get the following error message:

Error in system(cmd, intern = !verbose) : 'C:/Program' not found

我不确定这意味着什么.而且,我已经被困在那里几个小时了.任何人都可以帮我一下吗?

I'm not sure of what that means. And, I have been stuck there for a couple of hours now. Can anyone help me a bit, please?

推荐答案

Windows 上的 R 常见问题解答 在问题 2.2 中说:

The R on Windows FAQ says in Question 2.2:

如果您希望能够从源代码构建包,我们建议选择不包含空格的安装路径.

If you want to be able to build packages from sources, we recommend that you choose an installation path not containing spaces.

另请参阅该常见问题解答的问题 2.16.我相当确定我们也在 Rcpp 文档中反复强调了这一点.

Also see Question 2.16 of that FAQ. I am fairly certain that we also make that point repeatedly in the Rcpp documentation.

现在,如果您放弃内联包,并尝试在 RStudio 中工作,那么您可能会解决这个问题(因为有更多的努力来保护带有空格的 $PATH).

Now, if you forgo the inline package, and try working in RStudio, then you might get around this (as there are more efforts to protect the $PATH with spaces).

但简而言之,我会将 R 重新安装到 C:\R\R-$version 中,因为它是在所有示例上获得默认行为的唯一方法.我们有很多.值得重新安装.

But in short, I would reinstall R into, say C:\R\R-$version as it is the only way to get default behaviour on all examples. And we have lots of them. It's worth reinstalling.

这篇关于使用 Rcpp 找不到消息错误“C:/Program"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆