導航:首頁 > 源碼編譯 > 一個r標志的編譯軟體

一個r標志的編譯軟體

發布時間:2022-09-02 17:14:50

⑴ R語言用什麼編譯器,r3.1.2是不是編譯器感覺怪怪的

r3.1.2是R語言在windows下的控制台窗口。
我一直都是使用RStudio作為R語言的IDE來開發的,界面和matlab類似,操作方便,您可以試試,一定是你想要的。

⑵ R語言的編輯器有哪些哪個比較好

有R自帶的RGUI(R console),還有一個就是IDE開發工具Rstudio(可以免費下載),Rstudio適合開發,編寫代碼、結果輸出、圖形可視化可以在一個窗口中顯示。

⑶ 有一個播放器的圖標是有一個r的字母,那是什麼軟體

realplayer

⑷ r語言編譯器

  1. r語言是個語言環境,rstudio是編譯器。

  2. 實際上直接用r進行數據分析也不是不可以,但是個人使用經驗,在debugging的時候不太方便。

  3. rstudio本身能幫你完成模糊拼寫,特別是在你不特別清楚應該使用具體哪一個函數的時候。

  4. 可視化方面更好,代碼能夠展示得更加清晰。

  5. rstudio能夠直接幫助更新或者下載個中packages

  6. 具體使用看個人習慣吧。

    以上。

⑸ 一個批圖軟體,名字是英文的,開頭字母是r的,請問誰知道叫什麼

Rmiuc

⑹ 電腦里R圖標叫程序的軟體是什麼可以卸載嗎

有些游戲是R圖標的,還有個影子系統也是R圖標的

⑺ 如何在windows中編寫R程序包

在Windows環境下如何編寫R程序包,即生成供linux環境編譯運行的tar.gz文件,也生成供windows下使用的.zip文件呢?其實並不復雜,只要下載一些工具軟體,按照相應的步驟填寫相應的「表格」,繼而運行一些簡單的指令,就可以生成R的程序包了。

編寫R程序包通常包括以下幾步:

(1) 工具軟體Rtools的安裝和備選軟體的安裝。
(2) r腳本的准備,也就是用來生成程序包的函數腳本。
(3) 利用R中自帶的package.skeleton()函數,生成製作包所需要的Description 文件和幫助文件幫助文件.rd。
(4) 編輯該函數生成的Description 文件和幫助文件.rd
(5) 在windows cmd的命令行中輸入相應的命令,生成zip文件或者.tar.gz

下面我們來一起建立只有一個函數的R程序包,來詳細說明:

一 工具軟體安裝和配置
製作r包的工具軟體包括Rtools,HTML編譯器,MikTeX 或Cte等(備選軟體不一定要安裝):

1 工具軟體安裝
(1)Rtools(製作R包的主要工具)
Rtools是在windows下製作R包的一系列工具,其中包括
1) CYGWIN 在Windows下模擬UNIX環境
2) MinGW編譯器,可用來編譯C和Fortran語言。
3) Perl
下載地址: http://www.murdoch-sutherland.com/Rtools/

(2) 微軟HTML編譯器(備選):

用來從源文件生成HTML格式的幫助文件
下載地址:http://go.microsoft.com/fwlink/?LinkId=14188

(3) MikTeX 或CteX(備選)
用來生成pdf格式的幫助文件
下載地址:http://www.miktex.org/ www.ctex.org/
分別按照要求安裝好。

2 設置文件啟動路徑:
我的電腦>屬性>高級>環境變數>系統變數 PATH一項,點擊「編輯」,檢查是否具有以下路徑,如果沒有,需要手工添加:
c:\Rtools\bin;c:\Rtools\perl\bin;c:\Rtools\MinGW\bin; C:\CTEX\MiKTeX\miktex\bin;C:\CTEX\CTeX\ctex\bin;C:\CTEX\CTeX\cct\bin;C:\CTEX\CTeX\ty\bin;C:\CTEX\Ghostscript\gs8.64\bin;C:\CTEX\GSview\gsview;C:\CTEX\WinEdt;C:\Program Files\R\R-2.9.0\bin\;
設置啟動路徑的目的是在cmd命令行可以直接調用相應的exe文件。

如果只是簡單製作一個個人使用的包,只需將c:\Rtools\bin;c:\Rtools\perl\bin;c:\Rtools\MinGW\bin; 添加到系統路徑即可

二 R腳本的准備
假如現在我們已經有了一個編好的R函數,用來給出回歸的精確結果,存成了r腳本的格式,文件名為linmod.r
其內容如下所示,那麼該如何製作R程序包呢?

linmod<- function(x, y)
{
## compute QR-decomposition of x
qx <- qr(x)
## compute (x'x)^(-1) x'y
coef <- solve.qr(qx, y)
## degrees of freedom and standard deviation of resials
df <- nrow(x)-ncol(x)
sigma2 <- sum((y - x%*%coef)^2)/df
## compute sigma^2 * (x'x)^-1
vcov <- sigma2 * chol2inv(qx$qr)
colnames(vcov) <- rownames(vcov) <- colnames(x)
list(coefficients = coef,
vcov = vcov,
sigma = sqrt(sigma2),
df = df)
}

三 R包框架的准備
1 生成准備文件
登陸R :開始>所有程序>R>R.2.9.0
(1)清除內存中的對象:
rm(list=ls())
(2)設定工作目錄,這里設定為 c:/pa
setwd("c:/pa")
(3)將製作包的源文件 linmod.r拷貝到c:/pa/文件夾下,
之後輸入:
package.skeleton(name="linmod",code_files="c:/pa/linmod.r")

此時,R控制台中顯示
Creating directories ...
Creating DESCRIPTION ...
Creating Read-and-delete-me ...
Saving functions and data ...
Making help files ...
Done.
Further steps are described in './linmod/Read-and-delete-me'.
>

可以看到c:/pa文件夾下新出現了一個linmod文件夾
該文件夾下的內容就是R包的框架,包括data文件夾,man文件夾,只要按要求將其填寫完整,再進行相應的編譯即可。
首先查看Read-and-delete-me文件
文件內容如下:

* Edit the help file skeletons in 'man', possibly combining help
files for multiple functions.
* Put any C/C++/Fortran code in 'src'.
* If you have compiled code, add a .First.lib() function in 'R' to
load the shared library.
* Run R CMD build to build the package tarball.
* Run R CMD check to check the package tarball.
Read "Writing R Extensions" for more information.

大致意思如下:
可以man文件夾下編輯幫助文件
C/C++/Fortran 的源代碼應該放入src文件夾下
需要在登錄時載入包
可以運行R CMD建立和檢查相應的包
查看更多信息,應該閱讀Writing R Extensions

2 編輯Description文件和rd文件
(1) Description文件的編輯
按照提示,填好各項

Package: linmod
Type: Package
Title: test for linear regression
Version: 1.0
Date: 2009-07-20
Author: helixcn
Maintainer: helixcn <[email protected]>
Description: To give the exactly results of linear regression.
License: GNU 2 or later
LazyLoad: yes

(2)man文件夾中.rd文件編輯
man文件夾中包含兩個文件 linmod.Rd和linmod-package.Rd,分別是對linmod()函數和linmod包的介紹,下面逐項填寫:

1) linmod.Rd
\name{linmod}
\Rdversion{1.1}
\alias{linmod}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
linear regression
}
\description{
to give the more exactly results of linear regression
}
\usage{
linmod(x, y)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
\item{x}{
a numeric design matrix for the model
}
\item{y}{
a numeric vector of responses
}
}
\details{
%% ~~ If necessary, more details than the description above ~~
}
\value{

%% ~Describe the value returned
%% If it is a LIST, use
%% \item{comp1 }{Description of 'comp1'}
%% \item{comp2 }{Description of 'comp2'}
%% ...
}
\references{
Friedrich Leisch,2008 Creating R Packages: A Tutorial
}
\author{
helixcn
}
\note{
Please read Friedrich Leisch,2008
}
%% ~Make other sections like Warning with \section{Warning }{....} ~

\seealso{
%% ~~objects to See Also as \code{\link{help}}, ~~~
}
\examples{
##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (x, y)
{
qx <- qr(x)
coef <- solve.qr(qx, y)
df <- nrow(x) - ncol(x)
sigma2 <- sum((y - x \%*\% coef)^2)/df
vcov <- sigma2 * chol2inv(qx$qr)
colnames(vcov) <- rownames(vcov) <- colnames(x)
list(coefficients = coef, vcov = vcov, sigma = sqrt(sigma2),
df = df)
}
}
% Add one or more standard keywords, see file 'KEYWORDS' in the
% R documentation directory.
\keyword{ ~kwd1 }
\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line

2)linmod-package.Rd
\name{linmod-package}
\Rdversion{1.1}
\alias{linmod-package}
\alias{linmod}
\docType{package}
\title{Linear Regression Modification}
\description{to Give the more exactly output of linear regression rather than R default}
\details{
\tabular{ll}{
Package: \tab linmod\cr
Type: \tab Package\cr
Version: \tab 1.0\cr
Date: \tab 2009-07-20\cr
License: \tab GNU 2.0 or later\cr
LazyLoad: \tab yes\cr
}
~~The aim of the package was to give the more exactly output of linear regression~~ linmod~~
}
\author{helixcn
Maintainer: helixcn <[email protected]>}
\references{
Friedrich Leisch,2008,Creating R Packages: A Tutorial
}
\seealso{lm}
\examples{
data(cats, package="MASS")
mod1 <- linmod(Hwt~Bwt*Sex, data=cats)
mod1
summary(mod1)
}

四 通過cmd創建R包

開始>運行>cmd
鍵入 cd c:\pa\ 將工作目錄轉移到c:/pa下

鍵入 Rcmd build --binary linmod 製作window zip包
鍵入 Rcmd build linmod 製作linux平台下可運行的tar.gz包
命令運行完之後可以發現,在c:/pa/文件夾下分別生成了linmod.zip和linmod.tar.gz壓縮包。

注意R CMD 系列命令是在windows控制台下運行,而非R控制台

參考網址
[1]http://www.robjhyndman.com/researchtips/building-r-packages-for-windows/
[2]http://cran.r-project.org/doc/contrib/Leisch-CreatingPackages.pdf
[3]http://faculty.chicagobooth.e/peter.rossi/research/bayes%20book/bayesm/Making%20R%20Packages%20Under%20Windows.pdf
[4]http://www.biostat.uni-hannover.de/teaching/fallstudien/schaarschmidt2.pdf

閱讀全文

與一個r標志的編譯軟體相關的資料

熱點內容
伺服器的雙電是什麼意思 瀏覽:614
程序員離開後代碼運行幾天 瀏覽:386
多多樂app是什麼幹嘛的 瀏覽:346
文檔加密授權工具 瀏覽:436
命令與征服將軍閃退 瀏覽:132
vs2019預編譯怎麼設置 瀏覽:780
沈陽中軟python培訓班 瀏覽:493
逆戰文件夾怎麼放 瀏覽:120
怎麼統一刪除文件夾raw文件 瀏覽:121
卡爾曼濾波演算法書籍 瀏覽:769
安卓手機怎麼用愛思助手傳文件進蘋果手機上 瀏覽:844
安卓怎麼下載60秒生存 瀏覽:803
外向式文件夾 瀏覽:240
dospdf 瀏覽:431
怎麼修改騰訊雲伺服器ip 瀏覽:392
pdftoeps 瀏覽:496
為什麼鴻蒙那麼像安卓 瀏覽:736
安卓手機怎麼拍自媒體視頻 瀏覽:186
單片機各個中斷的初始化 瀏覽:724
python怎麼集合元素 瀏覽:481