1

如何在Debian 10安装rlang

 1 year ago
source link: https://www.myfreax.com/how-to-install-r-on-debian-10/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

如何在Debian 10安装rlang

R是一种开源编程语言,专门用于统计,计算和图形表示。它由R统计计算基金会支持

Updated At 20 Oct 2022 3 min read
By myfreax
如何在Debian 10安装rlang

如何在Debian 10安装rlang

R是一种开源编程语言,专门用于统计,计算和图形表示。它由R统计计算基金会支持,主要由统计学家和数据挖掘人员用于开发统计软件和执行数据分析。

本教程说明如何在Debian 10安装R。在继续本教程之前,请确保满足以下先决条件。

具有至少1G RAM的Debian 10系统。如果您的计算机的RAM不足1GB,则可以创建swap交换文件。您以具有sudo权限用户的登录。

Debian仓库中的R软件包经常过时。 我们将从CRAN维护的软件源安装R。要在Debian 10安装R,请按照以下步骤操作。

首先安装依赖软件,以通过HTTPS添加新的软件源。运行apt-key命令来启用CRAN软件源并将CRAN GPG密钥添加到您的系统。

然后更新软件包列表并安装R软件包 ,运行命令sudo apt update && sudo apt install r-base

当安装完成后,可以运行命令R --version打印R语言的版本。在撰写本文时,R的最新稳定版本是版本3.6.3。

sudo apt install dirmngr apt-transport-https ca-certificates software-properties-common gnupg2

sudo apt-key adv --keyserver keys.gnupg.net --recv-key 'E19F5F87128899B192B1A2C2AD5F960A256A04AF'
sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/debian buster-cran35/'

sudo apt update
sudo apt install r-base
R --version
R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
https://www.gnu.org/licenses/.

CRAN 安装 R模块

R如此受欢迎的主要原因之一是可通过CRAN获得的大量的第三方模块。如果尚未安装CRAN,请安装build-essential,其中包含编译R所需的工具。

如果以root或sudo身份安装 R模块,则将会全局安装并可供所有用户使用。要为当前的用户安装,请以当前用户运行sudo -i R命令。

举例来说,我们将安装名为stringr的模块,该模块可快速,正确实现常见的字符串操作。

以root用户身份打开R控制台,运行sudo -i R命令,

sudo apt install build-essential
sudo -i R
R version 3.5.1 (2018-07-02) -- "Feather Spray"
Copyright (C) 2018 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.

> 

以下命令在R控制台中执行。安装stringr包。安装将需要一些时间。完成后,加载库。

创建一个简单的字符向量,命名为tutorial。运行str_length函数,该函数将打印字符串的长度。

您可以在 CRAN软件包页面上找到更多R软件包,并与install.packages()一起安装。

install.packages("stringr")
library(stringr)

tutorial <- c("How", "to", "Install", "R", "on", "Debian", "9")

str_length(tutorial)
[1] 3 2 7 1 2 6 1

我们已向您展示如何在Debian 10安装R以及CRAN。如果您遇到问题或有反馈,请在下面发表评论。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK