I use a Flex/ColdFusion/MSSQl combo to take input from users to generate charts for a website . Is this possible in R? I have used RODBC and sqlQuery as a way of producing static graphs but cannot seem to find a way of doing it dynamically. Over to you JU
In R, graphs are typically created interactively. The plot( ) function opens a graph window and plots weight vs. miles per gallon. The next line of code adds a regression line to this graph.
The most commonly used graphs in the R language are scattered plots, box plots, line graphs, pie charts, histograms, and bar charts. R graphs support both two dimensional and three-dimensional plots for exploratory data analysis.
Method 2: R Code The simplest method is to use the export function from the plotly package. You simply specify which graph to save (called fig in our example) and specify the file location, name, and type with the file argument. This function can save plotly graphs as . png, .
Of course you can, you can use fantastic Apache module that allows stateless execution of R scripts - RApache. You can define an R script and catch (unserialize) plot parameters (e.g. via JSON or URL encoded string), plot the graph, and load result(s) with AJAX. That's pretty much what I did in my app.
If you're not satisfied with R graph capabilities (and I'm sure that's so not gonna happen), you can try out googleVis
or canvas
packages. The first one is "only" a library for GoogleVis API for R, and I'm sure you'll like the later if you're familiar with HTML5 canvas. Some lads found it useful.
So, the final answer is, yes, you can!. You only need to decide whether you're going to generate graphs on client or server-side. Of course, even if you decide to generate graphs on the client side, you must massage your data in R and return it in serialized form (JSON or XML encoded). I know that ExtJS 4 also has good interface for creating client-side graphs, but I haven't used it much (read: "at all").
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With