久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

從 .net 調(diào)用 R(編程語言)

Call R (programming language) from .net(從 .net 調(diào)用 R(編程語言))
本文介紹了從 .net 調(diào)用 R(編程語言)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我正在開發(fā)一個應(yīng)用程序,該應(yīng)用程序需要大量統(tǒng)計處理并將其輸出為 .net 桌面應(yīng)用程序中的圖像.這些問題,包括生成輸出圖像,似乎很適合 R http://www.r-project.組織/

I'm working on an application that requires a great deal of stastical processing and output as images in a .net desktop application. The problems, including generating the output images, seem like a natural fit for R http://www.r-project.org/

是否有允許我從 .net 調(diào)用 R 的包裝器、API、SDK 或端口?

Is there a wrapper, API, SDK, or port that will allow me to call R from .net?

推薦答案

R.NET 在 R.NET 的較新版本中存在相當(dāng)大的問題.如果它不能正常工作,它會工作得非常糟糕(并且會繼續(xù)這樣做,除非你知道如何修復(fù)它).

R.NET is pretty buggy with the newer version of R. And if it doesn't work right, it works terribly (and will continue to do so unless you know exactly how to fix it).

就我個人而言,我建議使用 R 腳本文件并執(zhí)行它們.你應(yīng)該做的是用

Personally, I'd recommend using R script files and executing them. What you should do is start your R script with

> sink()
> #set your working directory here with setwd()
> #your code comes in here
> sink(#name your output file here - could label it with a .txt if you please
+ )

從 .NET 開始,您必須通過鍵入 using System.Diagnostics 來包含 System.Diagnostics 命名空間,然后編寫以下代碼:

And from .NET, you have to include the System.Diagnostics namespace by typing using System.Diagnostics and then write this code:

string strCmdLine;
strCmdLine = "R CMD BATCH" + /* the path to your R script goes here */;
System.Diagnostics.Process.Start("CMD.exe",strCmdLine);
process1.Close();

然后您可以像這樣使用 StreamReader:

You can then use a StreamReader like this:

StreamReader ROutput = new StreamReader(/* your R output file's path should go here */)

然后根據(jù)需要解析它(如果您也需要幫助,請參閱 RegEx 和字符串的 split 方法).

And then parse it as you please (see RegEx and a string's split method if you need help with that too).

希望這有幫助!

這篇關(guān)于從 .net 調(diào)用 R(編程語言)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Is there a way to know if someone has bookmarked your website?(有沒有辦法知道是否有人為您的網(wǎng)站添加了書簽?)
Use of Different .Net Languages?(使用不同的 .Net 語言?)
Is there a C# library that will perform the Excel NORMINV function?(是否有執(zhí)行 Excel NORMINV 函數(shù)的 C# 庫?)
Determining an #39;active#39; user count of an ASP.NET site(確定 ASP.NET 站點的“活動用戶數(shù))
Select x random elements from a weighted list in C# (without replacement)(從 C# 中的加權(quán)列表中選擇 x 個隨機元素(無需替換))
Best way to keep track of current online users(跟蹤當(dāng)前在線用戶的最佳方式)
主站蜘蛛池模板: 国产免费成人 | 日本免费在线视频 | 麻豆成人91精品二区三区 | 黄色免费观看网站 | 一级免费毛片 | 182tv午夜| 国产精品爽爽爽 | 国产成人精品一区二区三区四区 | 精品视频999 | 第一福利丝瓜av导航 | 免费一级黄色录像 | 国产精品高潮呻吟久久 | 一区在线视频 | 日韩伦理在线播放 | 激情视频小说 | 国产三级视频在线 | 亚洲天堂一区 | 自拍视频一区 | 国产一级片在线 | 一区二区三区在线观看视频 | 中文字幕第一区综合 | 欧美一级日韩一级 | 亚洲区视频 | 黄色成人毛片 | 亚洲一区免费观看 | 91亚洲精品乱码久久久久久蜜桃 | 国产精品久久久久久久久 | 日韩成人三级 | 亚洲国产天堂 | 午夜久久久久久久 | 欧美视频在线一区 | 久久综合久 | 日韩av在线影院 | 国产精品久久久久久久 | 日韩欧美中文在线 | 亚洲国产一区在线观看 | 酒色成人网 | 欧美一级网站 | 亚洲福利片 | 激情综合五月天 | 欧美在线不卡 |