Hi, We are a company developing a software mainly in C++. We want to integrate R inside our software in order to use mainly the engine (usual stats as mean, sigma, Pearson, outlier detection, CPA, multivariate, ...) and probably later the chart solution. Of course we don''t want to temporary write the data to some csv files and then do an ugly system() call : system("RScript.exe myscript.R") for many legitimate reasons. We are also using Qt so a Qt to/from R wrapper could be interesting. For the moment, we have found these solutions : - using directly the standard R C API : R.h, Rmath.h, R_ext, .... - Rcpp : www.rcpp.org - QtInterfaces : http://r-forge.r-project.org/projects/qtinterfaces/ - RInside http://dirk.eddelbuettel.com/code/rinside.html Any advices ? Kind regards William. -- *William Tambellini* Senior Developper Phoenix, AZ, USA www.galaxysemi.com Semiconductor Intelligence Subscribe to our blog at http://www.galaxysemi.com/blog Join the support portal at http://support.galaxysemi.com Confidentiality Notice: The information contained in thi...{{dropped:9}}
Hi, We are a company developing a software mainly in C++. We want to integrate R inside our software in order to use mainly the engine (usual stats as mean, sigma, Pearson, outlier detection, CPA, multivariate, ...) and probably later the chart solution. Of course we don't want to temporary write the data to some csv files and then do an ugly system() call : system("RScript.exe myscript.R") for many legitimate reasons. We are also using Qt so a Qt to/from R wrapper could be interesting. For the moment, we have found these solutions : - using directly the standard R C API : R.h, Rmath.h, R_ext, .... - Rcpp : www.rcpp.org - QtInterfaces : http://r-forge.r-project.org/projects/qtinterfaces/ - RInside http://dirk.eddelbuettel.com/code/rinside.html Any advices ? Kind regards William. -- *William Tambellini* Senior Developper Phoenix, AZ, USA www.galaxysemi.com Semiconductor Intelligence Subscribe to our blog at http://www.galaxysemi.com/blog Join the support portal at http://support.galaxysemi.com Confidentiality Notice: The information contained in thi...{{dropped:9}}
Tambellini William <william.tambellini <at> galaxysemi.com> writes:> We want to integrate R inside our software in order to use mainly the > engine (usual stats as mean, sigma, Pearson, outlier detection, CPA, > multivariate, ...) and probably later the chart solution. > Of course we don't want to temporary write the data to some csv files > and then do an ugly system() call : system("RScript.exe myscript.R") for > many legitimate reasons.That is *precisely* the use case for RInside which you already found.> We are also using Qt so a Qt to/from R wrapper could be interesting.The RInside distribution contains *a fully working example* for a Qt-based C++ main program with an embedded R instance: RInside. Hope this helps, Dirk
Don't cross-post. If discussed further, this should probably be in r-devel, but I am not on that list. Also, what is your question? I don't really see a question here. It might be along the lines of what technical solutions others like, but your research seems thorough enough for you to apply your own opinions. If it is legal (this is not a legal advice forum), keep in mind that many of the valuable algorithms in R are really in packages, and they may have similar but different licensing restrictions than R. However, as long as your software conforms to GPL2 (used in house only or released with source code) you are probably most of the way there. If not, you may need to keep the system calls in there or start discussions with the individual package authors to avoid stepping on licensing mines. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Tambellini William <william.tambellini at galaxysemi.com> wrote:>Hi, > We are a company developing a software mainly in C++. > We want to integrate R inside our software in order to use mainly the >engine (usual stats as mean, sigma, Pearson, outlier detection, CPA, >multivariate, ...) and probably later the chart solution. > Of course we don't want to temporary write the data to some csv files >and then do an ugly system() call : system("RScript.exe myscript.R") >for >many legitimate reasons. > We are also using Qt so a Qt to/from R wrapper could be interesting. > For the moment, we have found these solutions : >- using directly the standard R C API : R.h, Rmath.h, R_ext, .... >- Rcpp : www.rcpp.org >- QtInterfaces : http://r-forge.r-project.org/projects/qtinterfaces/ >- RInside http://dirk.eddelbuettel.com/code/rinside.html > > Any advices ? >Kind regards >William.
Rcpp is great, and I second that suggestion. But you could also explore another route and use something like OpenCPU. OpenCPU is a framework for embedding R in systems and applications. It exposes a simple HTTP(s) RPC API to call R functions and scripts, and makes it easy to retrieve the resulting object and graphics in various formats. Hence, you can use any c++ http client library to connect to your OpenCPU computation server. This is perhaps a little more work than RInside, but the advantage is that R will run on a separate server, decoupled from your C++ software. In my experience this is often a good idea, because R can be a bit unpredictable and greedy with hardware resources. Furthermore, you don't need to install a copy of R on each of your software deployments: in a client/server design you can maintain a single centralized computation server that all clients connect to. Have a look at opencpu.org :-) -- View this message in context: http://r.789695.n4.nabble.com/About-integrating-R-inside-a-C-software-tp4678712p4678748.html Sent from the R devel mailing list archive at Nabble.com.