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

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

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

問題描述

我正在開發(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 的較新版本中存在相當大的問題.如果它不能正常工作,它會工作得非常糟糕(并且會繼續(xù)這樣做,除非你知道如何修復它).

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(跟蹤當前在線用戶的最佳方式)
主站蜘蛛池模板: 呦呦在线视频 | 成人性生交大片免费看中文带字幕 | 久久伊人一区 | 99爱视频 | 久久久久久黄 | 欧美一级网站 | 成人av免费 | 日韩精品免费一区 | 紧缚调教一区二区三区视频 | a在线观看 | 精品欧美一区二区三区久久久 | 亚洲第一视频网 | 亚洲精品国产电影 | 欧美bondage紧缚视频 | 在线欧美小视频 | 亚洲狠狠爱一区二区三区 | 欧美精品一区二区三区四区 | 日韩在线观看一区 | 亚洲精品乱码久久久久久蜜桃91 | 欧美久久久久久 | 波多野结衣亚洲 | 成人av片在线观看 | 中文字幕亚洲一区 | 久久久www成人免费精品 | a级黄色网 | 欧美日韩亚洲在线 | av中文字幕在线 | 久久精品国产清自在天天线 | 91av免费看 | japan21xxxxhd美女 日本欧美国产在线 | 国产精品久久久99 | 久综合 | 精品国产一区二区三区久久 | 国产成人jvid在线播放 | 国产一级片免费在线观看 | 国产一级在线 | 欧美电影一区 | 91视在线国内在线播放酒店 | 精品视频国产 | 日韩精品一区二区在线观看 | 一级大黄 |