R:无法安装rJava;什么是r-api-3.4? [英] R: Cannot install rJava; what is r-api-3.4?

查看:236
本文介绍了R:无法安装rJava;什么是r-api-3.4?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是R版本3.5.1的Ubuntu 18.04计算机,其安装方式如下此链接.我正在尝试安装CRAN软件包 rJava ,我可以通过以下方式进行安装(如解决方案

API版本由r-base-core提供.原因是二进制软件包(有时)取决于为其构建的R版本.这样,您只能安装适合在一起的软件包.

在您的情况下,您有来自Ubuntu主存储库(r-base-core 3.4.x提供r-api-3.4r-cran-rjava要求r-api-3.4)和自定义PPA(r-base-core 3.5.y提供r-api-3.5)的软件包).一种选择是仅使用Ubuntu的版本,即R 3.4.另一个解决方案是添加其他PPA:

sudo add-apt-repository ppa:marutter/c2d4u3.5
sudo apt-get update

之后,需要r-api-3.5r-cran-rjava版本应该可用. 另请参阅 http://rubuntu.netlify.com/post/2018-05-25-announcing-c2d4u3-5/ CRAN提供的R后向端口时,这是唯一的可能性.

I am on an Ubuntu 18.04 machine with R version 3.5.1, installed following this link. I am trying to install the CRAN package rJava, which I do the following way (as seen here):

sudo apt-get install r-cran-rjava

However, I get this:

The following packages have unmet dependencies:
 r-cran-rjava : Depends: r-api-3.4
E: Unable to correct problems, you have held broken packages.

But when I try:

sudo apt-get install r-api-3.4

I get:

E: Package 'r-api-3.4' has no installation candidate

How to overcome this problem with r-api-3.4? Basically, I need to install rJava to be able to install and use XLConnect... In Ubuntu 16.04, I had no problems whatsoever...

EDIT:

Apparently, r-api-3.4 should be provided by r-base-core. I do have r-base-core installed in its newest version, why do I still see errors then?

解决方案

The API versions are provided by r-base-core. The reason is that binary packages (sometimes) depend on the R version, for which they have been build. This way you can only install packages that fit together.

In your case you have packages from the main Ubuntu repository (r-base-core 3.4.x providing r-api-3.4 and r-cran-rjava requiring r-api-3.4) and from a custom PPA (r-base-core 3.5.y providing r-api-3.5). One option would be to only use the version from Ubuntu, i.e. R 3.4. Another solution is to add an additional PPA:

sudo add-apt-repository ppa:marutter/c2d4u3.5
sudo apt-get update

After that a version of r-cran-rjava requiring r-api-3.5 should be available. See also http://rubuntu.netlify.com/post/2018-05-25-announcing-c2d4u3-5/ and http://rubuntu.netlify.com/post/2018-06-11-r-3.5-on-debian-and-ubuntu-update/.

Finally, you always have the possibility to install the R packages directly from CRAN. That is currently the only possibility when you are using the CRAN supplied R backports on Debian.

这篇关于R:无法安装rJava;什么是r-api-3.4?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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