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")
廣告