📜  R-环境设置

📅  最后修改于: 2020-11-29 07:39:27             🧑  作者: Mango


本地环境设置

如果您仍然愿意为R设置环境,则可以执行以下步骤。

Windows安装

您可以从R-3.2.2 for Windows(32/64位)下载R的Windows安装程序版本,并将其保存在本地目录中。

因为它是Windows安装程序(.exe),名称为“ R-version-win.exe”。您可以双击并运行接受默认设置的安装程序。如果您的Windows是32位版本,它将安装32位版本。但是,如果您的Windows是64位的,则它将同时安装32位和64位版本。

安装后,您可以在Windows程序文件下的目录结构“ R \ R3.2.2 \ bin \ i386 \ Rgui.exe”中找到运行程序的图标。单击此图标将弹出R-GUI,它是进行R编程的R控制台。

Linux安装

对于许多版本的Linux, R可以R Binaries位置使用R作为二进制文件

安装Linux的说明因风味而异。在上述链接的每种Linux版本下都提到了这些步骤。但是,如果您很着急,则可以使用yum命令如下安装R-

$ yum install R

上面的命令将安装R编程的核心功能以及标准软件包,仍然需要其他软件包,然后可以启动R提示符,如下所示:

$ R
R version 3.2.0 (2015-04-16) -- "Full of  Ingredients"          
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-redhat-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many  contributors.                    
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

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提示符下使用install命令来安装所需的软件包。例如,以下命令将安装3D图表所需的plotrix软件包。

> install.packages("plotrix")