R 环境设置
如果你仍然愿意为 R 设置环境,则可以按照以下步骤操作。
视窗安装
你可以从以下位置下载 R 的 Windows 安装程序版本 适用于 Windows 的 R-3.2.2(32/64 位) 并将其保存在本地目录中。
因为它是一个名为“R-version-win.exe”的 Windows 安装程序 (.exe)。你只需双击并运行接受默认设置的安装程序。如果你的 Windows 是 32 位版本,它会安装 32 位版本。但是,如果你的 Windows 是 64 位的,那么它会同时安装 32 位和 64 位版本。
安装完成后,你可以在Windows Program Files下的目录结构“R\R3.2.2\bin\i386\Rgui.exe”中找到运行程序的图标。单击此图标会打开 R-GUI,它是用于 R 编程的 R 控制台。
Linux 安装
R 可在该位置以二进制形式用于许多版本的 Linux 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 命令来安装所需的包。例如,以下命令将安装 plotrix 3D 图表所需的软件包。
> install.packages("plotrix")