如何在Ubuntu 18.04上安装R [快速入门]

介绍 (Introduction)

R is an open-source programming language that specializes in statistical computing and graphics. In this tutorial, we will install R on an Ubuntu 18.04 server.

R是一种开源编程语言,专门研究统计计算和图形。 在本教程中,我们将在Ubuntu 18.04服务器上安装R。

For a more detailed version of this tutorial, with better explanations of each step, please refer to How To Install R on Ubuntu 18.04.

有关本教程的更详细版本,以及每个步骤的更好说明,请参阅如何在Ubuntu 18.04上安装R。

第1步-添加GPG密钥 (Step 1 — Add GPG Key)

Logged into your Ubuntu 18.04 server as a sudo non-root user, add the relevant GPG key.

以sudo非root用户身份登录到Ubuntu 18.04服务器,添加相关的GPG密钥。

  • sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9

    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9

第2步-添加R存储库 (Step 2 — Add the R Repository)

  • sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/'

    sudo add-apt-repository'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40 /'

If you’re not using 18.04, find the relevant repository from the R Project Ubuntu list, named for each release.

如果您未使用18.04,请从R Project Ubuntu列表 (为每个版本命名)中找到相关的存储库。

步骤3 —更新软件包列表 (Step 3 — Update Package Lists)

  • sudo apt update

    sudo apt更新

步骤4 —安装R (Step 4 — Install R)

  • sudo apt install r-base

    sudo apt安装r-base

If prompted to confirm installation, press y to continue.

如果提示您确认安装,请按y继续。

第5步-测试安装 (Step 5 — Test Install)

Start R’s interactive shell as root.

以root身份启动R的交互式shell。

  • sudo -i R

    须藤-i R

You should receive output similar to the following:

您应该收到类似于以下内容的输出:


   
   
Output
R version 4.0.0 (2020-04-24) -- "Arbor Day" Copyright (C) 2020 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) ... Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. >

This confirms that we’ve successfully installed R and entered its interactive shell.

这确认我们已经成功安装了R并进入了它的交互式外壳。

翻译自: https://www.digitalocean.com/community/tutorials/how-to-install-r-on-ubuntu-18-04-quickstart

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值