简体   繁体   English

R:为R项目编写高质量的GUI

[英]R: write a high-quality GUI for an R-project

I have written a piece of R-code that performs a numerical computation. 我写了一段执行数值计算的R代码。 Now, I want to implement it into a nice GUI. 现在,我想将它实现为一个漂亮的GUI。 I know that there are some R-packages, that allow to create GUIs from within R (eg gWidgets, RGtk2, ...). 我知道有一些R-package允许从R内创建GUI(例如gWidgets,RGtk2,...)。 However, they seem to be rather limited in the capabilities and complicate to build. 但是,它们似乎在功能上相当有限,并且构建起来很复杂。 So I thought about going the other way round and writing a windowed-program that incorporates my R-code. 所以我想过反过来写一个包含我的R代码的窗口程序。

Is it possible to write a nice GUI (for example in Visual Basic.NET or Java) that allows to gather some user inputs, call the R-computations and display the results? 是否可以编写一个很好的GUI(例如在Visual Basic.NET或Java中),它允许收集一些用户输入,调用R计算并显示结果? I ask for Visual Basic because there is this new R-Open that comes along with Visual Studio which makes me think the two must offer natural ways of collaboration with each other. 我要求使用Visual Basic,因为有一个新的R-Open与Visual Studio一起提供,这让我觉得两者必须提供相互协作的自然方式。 I also hope that I would be able to compile an exe with it in the end. 我也希望我能够最终用它编译一个exe。

Thank you very much for you Help! 非常感谢你的帮助! Bernd 贝恩德

You can embed R in C++ code. 您可以在C ++代码中嵌入R. There are examples in the R source code and documentation. R源代码和文档中有一些示例。

Very briefly, you'll need to build a shared DLL version of R (ie with the --enable-R-shlib option) from the source code, using the Windows Tools . 非常简单,您需要使用Windows工具从源代码构建R的共享DLL版本(即使用--enable-R-shlib选项)。 This is how GUIs like RStudio function. 这就是像RStudio这样的GUI的功能。

The R Admin manuals have detailed instructions. R Admin手册有详细说明。 The RInside package might make this a bit easier. RInside包可能会让这更容易一些。

With the shared DLL you could probably embed R in other languages (it works for R in Python ). 使用共享DLL,您可能可以在其他语言中嵌入R(它适用于Python中的R )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM