问题描述
我一直在为模拟项目开发R包,在我家里的计算机上,我已经使用RStudio来成功构建和安装它.但是,在大学的另一台计算机上,我遇到了麻烦...如果尝试在RStudio中构建二进制文件(也同样安装了它),则会收到错误消息;如果我只是编译源代码以获取.tar.gz,则它可以正常工作,但是当我开始安装时,我再次收到错误消息.两次均发生错误的读数如下.我认为这与库有关,但是为什么这与我的家用计算机有所不同,我也不知道,我不是程序员,所以在这台计算机上安装R和RTools和RStudio的方式与我个人上的安装方式完全相同机器. -我有几天的管理员权限.
I've been working on a R package for a simulation project, on my computer at home I've used RStudio to build and install it successfully. However on another machine at university I'm having trouble... If I try and build a binary in RStudio, which also installs it too, I get an error, If I just compile a source to get a .tar.gz it works, but then when I come to install I get the error again. The readout with error that occurs both times, is below. I think it has something to do with libraries, but why this would be different to my home computer I would not know, I'm no programmer, and installed R and RTools and RStudio in exactly the same way on this machine as on my personal machine. - I have admin access for a few days.
install.packages("speEaR_1.0.tar.gz", repos=NULL, type="source")
Installing package(s) into ‘\\ueahome5/ressci17/yrq12edu/data/Documents/R/win-library/2.15’
(as ‘lib’ is unspecified)
* installing *source* package 'speEaR' ...
** R
** preparing package for lazy loading
** help
Warning: C:/Users/yrq12edu/AppData/Local/Temp/Rtmp84HJPx/R.INSTALL7e81a241d97/speEaR/man/makeSetMatrix.Rd:25: unknown macro '\begin'
Warning: C:/Users/yrq12edu/AppData/Local/Temp/Rtmp84HJPx/R.INSTALL7e81a241d97/speEaR/man/makeSetMatrix.Rd:26: unknown macro '\item'
Warning: C:/Users/yrq12edu/AppData/Local/Temp/Rtmp84HJPx/R.INSTALL7e81a241d97/speEaR/man/makeSetMatrix.Rd:30: unknown macro '\end'
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) :
no library trees found in 'lib.loc'
Error: loading failed
Execution halted
*** arch - x64
Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) :
no library trees found in 'lib.loc'
Error: loading failed
Execution halted
ERROR: loading failed for 'i386', 'x64'
* removing '\\ueahome5/ressci17/yrq12edu/data/Documents/R/win-library/2.15/speEaR'
Warning messages:
1: running command 'C:/PROGRA~1/R/R-215~1.2/bin/i386/R CMD INSTALL -l "\\ueahome5/ressci17/yrq12edu/data/Documents/R/win-library/2.15" "speEaR_1.0.tar.gz"' had status 1
2: In install.packages("speEaR_1.0.tar.gz", repos = NULL, type = "source") :
installation of package ‘speEaR_1.0.tar.gz’ had non-zero exit status
推荐答案
几天前我遇到了类似的错误.这是因为您要安装到以下目录:
I had encountered a similar error a few days ago. It is because you are installing to this directory:
'\\ueahome5/ressci17/yrq12edu/data/Documents/R/win-library/2.15/speEaR'
我猜它已连接到网络驱动器.您应该做的是转到该网络驱动器,并像
I guess it is connected to a network drive. What you should do is go to that network drive and copy the address explicitly like
'M:/ressci17/yrq12edu/data/Documents/R/win-library/2.15/'
然后在安装时使用它来指定库的位置.例如:
And then use it to specify the library location when you install. For example:
install.packages("speEaR_1.0.tar.gz", repos=NULL, type="source",lib='U:/ressci17/yrq12edu/data/Documents/R/win-library/2.15/')
或尝试使用 devtools ,打开tar球的包装,然后执行以下操作:
Or try devtools , unpack your tar ball and do something like:
library(devtools)
has_devel() ## check if your Rtools are properly installed
check('speEaR')
##build('speEaR')
install("speEaR",args='-l "U:/ressci17/yrq12edu/data/Documents/R/win-library/2.15/"')
这就是我解决问题的方式.
This is how I solved my problem.
这篇关于R自定义软件包从文件安装错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!