One example of RInside does something pretty close - about 200 lines, most of which deal with other aspects of the GUI, it wraps R functionality inside a Qt application.
In the example, the density slider of the graphical user interface is implemented, and in the edit field you can write an almost arbitrary expression R, or rather parts that are then passed to the estimate to generate a random number: rnorm(50) or for the mixture c(rnorm(50), rt(50)) , etc. You could build on top of this.
See the blog post for more details.
source share