Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrating R with existing C# website

Tags:

r

web-services

We have existing website built in C# and hosted on a shared Windows server. The aim is to build a simple app within existing website that would take in some data, entered by user, and process it using some R scripts (some statistics) and publish the output on the website in a static (dynamic?) format.

Basic requirements:

  1. Secure
  2. Relatively inexpensive
  3. Low maintenance requirements

What are the existing options?

  • Does Microsoft offer an out-of-the-box solution, given their heavy activity (Revolution R)?
  • R.NET could be used if the hosting company (private hosting) allowed R installation on their server (website hosted there). I’m not sure how good this solution would be, however.
  • What are the other options apart from Shiny?

Old entry on similar issue on SO: Where can I find a hosting service with R?

like image 210
Maximilian Avatar asked Sep 11 '16 09:09

Maximilian


People also ask

How do you call C from R?

The most basic method for calling C code from R is to use the . C() function described in the System and foreign language interfaces section of the Writing R Extensions manual. Other methods exist including the . Call() and .

Is R written in C?

The official R software environment is an open-source free software environment within the GNU package, available under the GNU General Public License. It is written primarily in C, Fortran, and R itself (partially self-hosting). Precompiled executables are provided for various operating systems.

What is C () R?

c() function in R Language is used to combine the arguments passed to it.

What does \n do in C?

The newline character ( \n ) is called an escape sequence, and it forces the cursor to change its position to the beginning of the next line on the screen. This results in a new line.


2 Answers

A Shiny app can absolutely be integrated into a webpage, typically as an iframe hosted by shinyapps.io, and embedded into your website. See Shiny homepage for an example. You can see some pointers in Embedding a Shiny application in a html document on Google Groups.

A solution more in line with what was asked is to use a server application like RServe to facilitate communication between a running R session and a .NET/C# application. Since RServe allows for remote connections, it can be used by an existing website, with the RServer running on a different server.

like image 144
yeedle Avatar answered Oct 18 '22 21:10

yeedle


Probably your best bet is to fire up an amazon ec2 windows image. install R. use R.NET. done.

like image 28
ZagNut Avatar answered Oct 18 '22 21:10

ZagNut