Hi all, Is there a way to pass R code from web page (html file) to do some statistics and than plot the output in web browser. I am looking forever at this, and cant find a way. Regards,m -- View this message in context: http://r.789695.n4.nabble.com/Passing-R-code-from-webpage-tp4658800.html Sent from the R devel mailing list archive at Nabble.com.
hi , First of all you should as this question on r-help rather than on r-devel as this group deals with development related issues with R. As for the package you can use the shiny package from Rstudio. I have provided the links below. http://shiny.rstudio.org/ http://www.rstudio.com/shiny/ regards, Pulkit On Sat, Feb 16, 2013 at 3:48 PM, Matevz Pavlic <matevzpavlic@gmail.com>wrote:> Hi all, > > Is there a way to pass R code from web page (html file) to do some > statistics and than plot the output in web browser. > > I am looking forever at this, and cant find a way. > > Regards,m > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/Passing-R-code-from-webpage-tp4658800.html > Sent from the R devel mailing list archive at Nabble.com. > > ______________________________________________ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >[[alternative HTML version deleted]]
If R and ghostcript are installed on the server that hosts you webpage, it is easy. All you need is a minimum of php. I started with doR (which I think does not exist anymore) and modified it. Even better, some people offers a solution for you. Here is a GPL licenced solution. http://steve-chen.net/document/r/r_php Le 2013-02-16 18:48, Matevz Pavlic a ?crit :> Hi all, > > Is there a way to pass R code from web page (html file) to do some > statistics and than plot the output in web browser. > > I am looking forever at this, and cant find a way. > > Regards,m > > > > -- > View this message in context: http://r.789695.n4.nabble.com/Passing-R-code-from-webpage-tp4658800.html > Sent from the R devel mailing list archive at Nabble.com. > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
On Feb 16, 2013, at 5:48 PM, Matevz Pavlic <matevzpavlic at gmail.com> wrote:> Hi all, > > Is there a way to pass R code from web page (html file) to do some > statistics and than plot the output in web browser. > > I am looking forever at this, and cant find a way. > > Regards,mYou might have wanted to start by looking at the R FAQ, which contains the following: http://cran.r-project.org/doc/FAQ/R-FAQ.html#R-Web-Interfaces More recently, there is Shiny, which I did not see listed in the above: http://www.rstudio.com/shiny/ Regards, Marc Schwartz
On Feb 16, 2013, at 6:48 PM, Matevz Pavlic wrote:> Hi all, > > Is there a way to pass R code from web page (html file) to do some > statistics and than plot the output in web browser. > > I am looking forever at this, and cant find a way. >Typically this is done by sending an AJAX request to R and display the result (or simple forms if you want to). I use FastRWeb for this - it even has an example on how you create plots and other output. There is also rApache if you are using apache web server. Cheers, Simon> Regards,m > > > > -- > View this message in context: http://r.789695.n4.nabble.com/Passing-R-code-from-webpage-tp4658800.html > Sent from the R devel mailing list archive at Nabble.com. > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > >
----------------------------------------> From: simon.urbanek at r-project.org > Date: Sun, 17 Feb 2013 09:16:57 -0500 > To: matevzpavlic at gmail.com > CC: r-devel at r-project.org > Subject: Re: [Rd] Passing R code from webpage > > On Feb 16, 2013, at 6:48 PM, Matevz Pavlic wrote: > > > Hi all, > > > > Is there a way to pass R code from web page (html file) to do some > > statistics and than plot the output in web browser. > > > > I am looking forever at this, and cant find a way. > > > > Typically this is done by sending an AJAX request to R and display the result (or simple forms if you want to). I use FastRWeb for this - it even has an example on how you create plots and other output. There is also rApache if you are using apache web server.Depending on how you want to use it, as others have suggested, there are a lot of approaches. Invoking an "R" process is a bit expensive and having a single R server available is much more efficient however for what we were doing the bigger gain was from caching results. That is, we have maps by area, say state or zip code, where we can tolerate results a few minutes old. So, we used a custom java server to invoke R as part of a general ability to execute bash scripts and then buffer the resulting images in memory. This approach worked well but did potentially require starting a new Rprocess for each request. I had always wanted to make use of shared R instances but never got around to doing this as the scaling never became relevant.? Our interface was something simple, like "http://host/Rscriptname?zip=00000&otherkeys=value" which would return an result with appropriate mime type to keep browser happy and have it fit on page ok etc. The point is that ?anything that can invoke a bash script can invoke R and if ?you are concerned about doing this efficiently it is not hard to write a simple java app that listens on a port and can invoke R and then do caching to meet your needs if apache etc does not do this easily.?> > Cheers, > Simon > > > > Regards,m > > > > > > > > -- > > View this message in context: http://r.789695.n4.nabble.com/Passing-R-code-from-webpage-tp4658800.html > > Sent from the R devel mailing list archive at Nabble.com. > > > > ______________________________________________ > > R-devel at r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-devel > > > > > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
----------------------------------------> Date: Sun, 17 Feb 2013 04:27:38 -0800 > From: mehrotra.pulkit at gmail.com > To: matevzpavlic at gmail.com > CC: r-devel at r-project.org > Subject: Re: [Rd] Passing R code from webpage > > hi , > > First of all you should as this question on r-help rather than on r-devel > as this group deals with development related issues with R.Well, personally this potentially a rather substantial issue and while methods may exist to interface R to webservers, it may be worth discussing if there are any things you could do to R to make it run more easily as an "R" server so that you need not make a bunch of instance to run in this setting. If 10 people on the same machine use R, what duplication is there? Can I launch a background task within R and still work in foreground? Is there anything anyone could should or wants to change in R to make this work better here??> > As for the package you can use the shiny package from Rstudio. I have > provided the links below. > > http://shiny.rstudio.org/ > http://www.rstudio.com/shiny/ > > regards, > Pulkit > > On Sat, Feb 16, 2013 at 3:48 PM, Matevz Pavlic <matevzpavlic at gmail.com>wrote: > > > Hi all, > > > > Is there a way to pass R code from web page (html file) to do some > > statistics and than plot the output in web browser. > > > > I am looking forever at this, and cant find a way. > > > > Regards,m > > > > > > > > -- > > View this message in context: > > http://r.789695.n4.nabble.com/Passing-R-code-from-webpage-tp4658800.html > > Sent from the R devel mailing list archive at Nabble.com. > > > > ______________________________________________ > > R-devel at r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-devel > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
No one yet has mentioned shiny (http://www.rstudio.com/shiny/); it allows you to get up and prototyping quickly, and we're working on ways to make it just as easy to scale to multiple users (currently it's possible, but you have to be willing to get your hands dirty configuring servers etc). Hadley On Sat, Feb 16, 2013 at 5:48 PM, Matevz Pavlic <matevzpavlic at gmail.com> wrote:> Hi all, > > Is there a way to pass R code from web page (html file) to do some > statistics and than plot the output in web browser. > > I am looking forever at this, and cant find a way. > > Regards,m > > > > -- > View this message in context: http://r.789695.n4.nabble.com/Passing-R-code-from-webpage-tp4658800.html > Sent from the R devel mailing list archive at Nabble.com. > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel-- Chief Scientist, RStudio http://had.co.nz/