所以,现在我已经设法在 WindowsXP (VirtualBox)上编译 RInside 的hello程序。但是,当我点击它的可执行文件时,我会看到一个显示上述错误的对话框。
Google搜索引导我this thread他们在谈论以下设置。
R:
> Sys.getenv("R_LIBS")
[1] ""
> Sys.getenv("R_LIBS_USER")
[1] "C:\\Documents and Settings\\admin\\My Documents/R/win-library/2.15"
> Sys.getenv("R_HOME")
[1] "C:/R-2.15.1"
> sessionInfo ()
R version 2.15.1 (2012-06-22)
Platform: i386-pc-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
>
从这里开始:http://cran.r-project.org/bin/windows/base/rw-FAQ.html#How-do-I-set-environment-variables_003f
环境变量的优先顺序是列出这些选项的顺序,即命令行。然后是继承环境。
路径:
Rcmd_environ:
## from R.sh
R_SHARE_DIR=${R_HOME}/share
R_INCLUDE_DIR=${R_HOME}/include
R_DOC_DIR=${R_HOME}/doc
R_ARCH=
## from Rcmd
R_OSTYPE=windows
TEXINPUTS=.;${TEXINPUTS};${R_SHARE_DIR}/texmf/tex/latex;
BIBINPUTS=.;${BIBINPUTS};${R_SHARE_DIR}/texmf/bibtex/bib;
BSTINPUTS=.;${BSTINPUTS};${R_SHARE_DIR}/texmf/bibtex/bst;
## from etc/Renviron
# R_PLATFORM='i386-pc-mingw32'
R_PAPERSIZE_USER=${R_PAPERSIZE}
R_PAPERSIZE=${R_PAPERSIZE-'a4'}
# for Rd2dpf, reference manual
R_RD4PDF=${R_RD4PDF-'times,inconsolata,hyper'}
## used for options("texi2dvi")
# R_TEXI2DVICMD=${R_TEXI2DVICMD-${TEXI2DVI-'texi2dvi'}}
## used by INSTALL, check, build
R_GZIPCMD=${R_GZIPCMD-'gzip'}
## Default zip/unzip commands
R_UNZIPCMD=${R_UNZIPCMD-'unzip'}
R_ZIPCMD=${R_ZIPCMD-'zip'}
R_BZIPCMD=${R_BZIPCMD-'bzip2'}
## Default browser
# R_BROWSER=${R_BROWSER-'open'}
## Default editor
# EDITOR=${EDITOR-${VISUAL-vi}}
## Default pager
# PAGER=${PAGER-''}
## Default PDF viewer
# R_PDFVIEWER=${R_PDFVIEWER-'open'}
# MAKE=${MAKE-make}
SED=${SED-sed}
R_LIBS=c:/DOCUME~1/admin/MYDOCU~1/R/win-library/2.15;
Rprofile:
# Things you might want to change
# options(papersize="a4")
# options(editor="notepad")
# options(pager="internal")
# set the default help type
# options(help_type="text")
options(help_type="html")
# set a site library
.Library.site <- file.path(chartr("\\", "/", R.home()), "site-library")
# set a CRAN mirror
# local({r <- getOption("repos")
# r["CRAN"] <- "http://my.local.cran"
# options(repos=r)})
# Give a fortune cookie, but only to interactive sessions
# (This would need the fortunes package to be installed.)
# if (interactive())
# fortunes::fortune()
请指出我错过的一点。
答案 0 :(得分:6)
此错误将在下一个版本中获得一些帮助。发生的事情是,当构建 RInside CRAN包时,检测并编译R_HOME
。使用构建机器的值。不是你的。
答案是:a)在本地构建RInside以便它存储您的R_HOME
值或b)来设置环境变量R_HOME
[并且仅在Windows上需要,因为只有Windows可以为您提供预建版本]。在下一个版本中,我们还将使用R中的一些代码在您的注册表中查找;参见SVN回购。
然而,此问题曾多次被提及并得到解决。