R - 环境设置

本地环境设置

如果您仍然愿意为R设置环境,可以按照以下步骤进行操作.

Windows安装

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

因为它是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安装

R可用作二进制文件 R二进制文件位置的许多Linux版本.

安装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")