标签: r

如何检查系统上安装的 R 语言版本?

几个月前,我在 Fedora-20 系统上安装了 r 语言和 r studio。在那之后,我开始忙碌,现在又回到了它。我想知道我的 R 版本是什么,但找不到任何帮助。是否有任何命令/函数可以用来找出 r 和 rstudio 的版本?

r rstudio

59
推荐指数
4
解决办法
32万
查看次数

在 Ubuntu 中安装 RODBC 的问题

尝试在我的 linux 上的 R 中安装 RODBC 时,我遇到了一些缺少标头的问题。谁能帮我解决这个问题?

> install.packages("RODBC")

Installing package(s) into ‘/home/administrator/R/x86_64-pc-linux-gnu-library/2.12’
(as ‘lib’ is unspecified)

trying URL 'http://cran.cnr.Berkeley.edu/src/contrib/RODBC_1.3-2.tar.gz'
Content type 'application/x-gzip' length 1108358 bytes (1.1 Mb)

opened URL
==================================================
downloaded 1.1 Mb

* installing *source* package ‘RODBC’ ...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking …
Run Code Online (Sandbox Code Playgroud)

r ubuntu

32
推荐指数
3
解决办法
3万
查看次数

在 RHEL 7 上安装 R

我正在尝试在 RHEL 7 上安装 R。我正在使用 epel-release-7-2.noarch.rpm 并解决了许多依赖项(通过手动 .rpm 安装一个一个),但在依赖项解析结束时我得到了这些错误:

--> Finished Dependency Resolution Error: Package: R-core-3.1.1-7.el7.x86_64 (epel) Requires: tex(dvips) Error: Package: R-core-devel-3.1.1-7.el7.x86_64 (epel) Requires: texinfo-tex Error: Package: R-java-devel-3.1.1-7.el7.x86_64 (epel) Requires: java-devel Error: Package: R-core-3.1.1-7.el7.x86_64 (epel) Requires: tex(latex) Error: Package: R-core-devel-3.1.1-7.el7.x86_64 (epel) Requires: tex(latex) You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest

我使用的系统没有注册到 Red Hat Subscription Management,所以我不能使用 subscription-manager 来注册它并解决依赖关系。

我在哪里可以找到 tex(dvips) 和 tex(latex)?我正在尝试从 mirror.centos.org/centos/7/os/x86_64/Packages/ 下载它,但我仍然没有找到正确的文件

更新: 最后我自己解决了更新 RHEL 存储库的问题: cd /etc/yum.repos.d/ …

r redhat-enterprise-linux

14
推荐指数
4
解决办法
4万
查看次数

崇高的文本键盘快捷键绑定不起作用

按照此处的说明,我已经设置了一个新的 SublimeText 安装以与 R 一起使用。我没有安装其他 SublimeText 插件。使用上述链接中的说明设置的键盘快捷键不起作用。我已经按照教程中的说明设置了我的用户密钥绑定文件。

“默认”键绑定文件中没有冲突的键绑定。

尽管如此,我可以通过单击菜单在 REPL 中执行我的 R 代码:

工具 > SublimeREPL > REPL 中的 Eval > 选择 ( Ctrl+ Shift+ R)

如果我真的按下Ctrl+ Shift+R快捷方式,则什么也不会发生。

这是我的用户密钥绑定文件的副本:

[
// Modified Sublime-REPL keybindings for an "R-friendly" set of shortcuts.
// For more information, see http://tomschenkjr.net/2012/05/17/using-sublime-text-2-for-r/

// Executes a selection of text in REPL, latter only displays code and does not execute
{ "keys": ["ctrl+shift+r"], "command": "repl_transfer_current", "args": …
Run Code Online (Sandbox Code Playgroud)

keyboard-shortcuts r sublime-text-2

13
推荐指数
1
解决办法
7712
查看次数

更改主目录中的 RStudio 库路径

每次 RStudio 启动时,它都会检查并创建 ~/R(如果它不存在)。我想在别处改变这条路。我该如何进行此配置?

我知道

HOME=/some/path rstudio
Run Code Online (Sandbox Code Playgroud)

将工作。但是我可以通过一些配置文件进行配置吗?

path r rstudio

10
推荐指数
1
解决办法
2万
查看次数

在 Ubuntu 11.04 上安装最新的 R 版本 (2.13.0)

我刚刚将我的 Ubuntu 桌面 10.10 升级到 11.04。我一切正常,除非尝试将当前的 R 2.12.1 更新到 R 2.13.0。

我按照自述文件:

http://cran.r-project.org/bin/Linux/Ubuntu/README

并添加

deb http://cran.xl-mirror.nl/bin/Linux/Ubuntu natty/
deb-src http://cran.xl-mirror.nl/bin/Linux/Ubuntu natty/
deb http://nl.archive.Ubuntu.com/Ubuntu/ natty-backports restricted main multiverse universe
Run Code Online (Sandbox Code Playgroud)

给我的

/etc/apt/sources.list

并且还添加了

CRAN 上的 Ubuntu 档案使用“Michael Rutter”的密钥签名,密钥 ID 为 E084DAB9。您可以使用

  gpg --keyserver keyserver.Ubuntu.com --recv-key E084DAB9
Run Code Online (Sandbox Code Playgroud)

然后将其提供给 apt-key

   gpg -a --export E084DAB9 | sudo apt-key add -
Run Code Online (Sandbox Code Playgroud)

它出现在突触包管理器中(所以我认为它有效)。

但是在运行时sudo apt-get update我收到一条错误消息:

阅读包裹清单...错误!

E: 遇到没有包的部分: 标题 E: MergeList 有问题 /var/lib/apt/lists/cran.xl-mirror.nl_bin_linux_ubuntu_natty_en E: 包列表或状态文件无法解析或打开。E: _cache->open() 失败,请报告。

初始化包信息时出现无法解决的问题。

请针对“update-manager”包报告此错误,并包含以下错误消息:

'E:Encountered a section with no …

r ubuntu updates ubuntu-11.04 apt-get

8
推荐指数
1
解决办法
6316
查看次数

Brew 安装 R:权限被拒绝

当尝试通过 Brew 安装 R 时,我收到以下输出和错误:

==> Pouring pcre-8.43.mojave.bottle.tar.gz 
cp: /usr/local/Cellar/pcre/./8.43: 
cp: /var/folders/3l/zsdg6x9x61g8nhnb8f6pxzvw0000gn/T/d20190415-7574-1t8em0n/pcre/./8.43: unable to copy extended attributes to /usr/local/Cellar/pcre/./8.43: Permission denied
cp: /usr/local/Cellar/pcre/./8.43/INSTALL_RECEIPT.json: No such file or directory
cp: /usr/local/Cellar/pcre/./8.43/bin: No such file or directory

....

cp: utimes: /usr/local/Cellar/pcre/.: Operation not permitted
Error: Failure while executing; `cp -pR /var/folders/3l/zsdg6x9x61g8nhnb8f6pxzvw0000gn/T/d20190415-7574-1t8em0n/pcre/. /usr/local/Cellar/pcre` exited with 1. Here's the output:
cp: /usr/local/Cellar/pcre/./8.43: Permission denied
cp: /var/folders/3l/zsdg6x9x61g8nhnb8f6pxzvw0000gn/T/d20190415-7574-1t8em0n/pcre/./8.43: unable to copy extended attributes to /usr/local/Cellar/pcre/./8.43: Permission denied

....

Warning: Bottle installation failed: building from source.
Error: …
Run Code Online (Sandbox Code Playgroud)

permissions homebrew r macos macos-mojave

8
推荐指数
2
解决办法
2万
查看次数

在 Ubuntu 中获取 R 3.0

我目前在 Ubuntu 中使用R 2.15.3(安全毯)。R 3.0已经发布,但我无法使用 apt-get 更新到它。如果我从 cran 网站从 tar.gz 安装它会不会有什么问题?

r ubuntu apt-get

6
推荐指数
1
解决办法
3877
查看次数

为什么 R 无法将绘图渲染为 PNG 文件?

我试图让 R 在 UNIX 中做一些非常基本的绘图等,但是我收到了一个与 X11 相关的奇怪错误,据我所知,我什至不需要 X11。

我有一个矩阵名称d,想保存该矩阵的热图图像,而无需实际显示图像(因为我不想使用 X11)。这是我的代码:

png(file="my_image.png")
heatmap(d)
dev.off()
Run Code Online (Sandbox Code Playgroud)

问题是我收到以下错误:

Error in X11(paste("png::", filename, sep = ""), g$width, g$height, pointsize,  :
  unable to start device PNG
Run Code Online (Sandbox Code Playgroud)

另外: 警告信息:

In png(file = "interative_hen.png") :
  unable to open connection to X11 display ''
Run Code Online (Sandbox Code Playgroud)

我不知道这种情况正在发生,因为我不知道 R 是如何需要 X11 的,即使它需要 X11,X11 也已安装并为我测试过的每个应用程序正常工作。

linux png unix r x11-forwarding

6
推荐指数
1
解决办法
1万
查看次数

用 MS Word 保存的 .pdf 图像中奇怪的额外线条(发生在来自 R 的图像和可能的其他图像中)

我使用 MS Word 2010 将文档另存为 .pdf 文件,有些图像上有奇怪的额外线条。无论源文档是 .doc 文件还是 .docx 文件,都会发生这种情况:

在此处输入图片说明

谁能解释发生了什么,我能做些什么?

注意:我真的在寻找关于 MS Word 发生了什么以及如何让它正确创建我的 PDF 的解释,而不是我可以用来从 .doc 或 .docx 文件创建 .pdf 文件的其他程序。


编辑:当我最初问这个问题时,我根本不知道图像的来源很重要,但是因为我发现问题的一部分是 R 统计程序生成具有透明度的图像(不通知用户) ,我正在R为这个问题添加标签。这个问题很可能在不使用 R 的情况下突然出现,但是有很多人使用 R 生成图像以在 MS Word 中使用然后输出到 PDF,如果他们应该能够更容易地找到这个问题比我更聪明,并猜测图像的来源可能很重要。

pdf r images microsoft-word microsoft-word-2010

5
推荐指数
2
解决办法
5万
查看次数