R - 环境设置



本地环境设置

如果您仍然希望为 R 设置您的环境,您可以按照以下步骤操作。

Windows 安装

您可以从 R-3.2.2 for Windows (32/64 bit) 下载 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 安装

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 命令安装所需的包。例如,以下命令将安装 3D 图表所需的 plotrix 包。

> install.packages("plotrix")
广告

© . All rights reserved.