简体   繁体   English

在Mac上使用R CMD INSTALL安装本地二进制软件包

[英]Installing local binary packages using R CMD INSTALL on a Mac

I came across a package that is not available on CRAN. 我遇到了CRAN上没有的软件包。 I tried to install the package using: 我尝试使用以下方法安装软件包:

Packages & Data > Package Installer > Local Binary Package > At User Level > [FileName.tgz] > Install... 软件包和数据>软件包安装程序>本地二进制软件包>在用户级别> [FileName.tgz]>安装...

This didn't work and I am now trying to use the R CMD INSTALL command. 这没有用,我现在尝试使用R CMD INSTALL命令。 However, it seems I need to run that command in the command line interface but I cannot get it to install properly. 但是,似乎我需要在命令行界面中运行该命令,但无法正确安装它。

The package I'm trying to install is called gEcon . 我要安装的软件包称为gEcon It can be found here . 可以在这里找到。 In particular, I am getting the following error message after "installing" the package: 特别是,“安装”软件包后,我收到以下错误消息:

Error: package or namespace load failed for ‘gEcon’:
package ‘gEcon’ was installed by an R version with different internals; it needs to be reinstalled for use with this R version

I assume it's the way I'm installing it. 我认为这就是我的安装方式。

Thanks in advance. 提前致谢。

You're going to need to install Xcode apparently, because you've got to install this from source per these directions : 您显然需要安装Xcode,因为您必须按照以下说明从源代码安装它:

Now, you've gotta update R to the latest stable release, or if you prefer you can find the exact minimum newest version needed for gEcon. 现在,您必须将R更新到最新的稳定版本,或者,如果您愿意,可以找到gEcon所需的确切最低最新版本。

After upgrading R you can complete the installation from source. 升级R后,您可以从源代码完成安装。

Original answer to original question: 原始问题的原始答案:

Two things: 两件事情:

  1. To access the command line and use R CMD on an Apple computer, please use the terminal.app app. 要访问命令行并在Apple计算机上使用R CMD ,请使用terminal.app应用。 Please see this for more details. 请参阅以获取更多详细信息。

  2. An easier and probably better approach is to install your package from the author's Github (or BitBucket, etc) repository using devtools::install_github or just use devtools::install on the downloaded source project. 一种更简单,可能更好的方法是使用devtools::install_github或从下载的源项目中使用devtools::install从作者的Github(或BitBucket等)存储库安装软件包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM