Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Side question: Can I create interactive visualizations with R? Something akin to D3 in javascript?


I strongly recommend using Plotly, specifically ggplotly (https://plot.ly/ggplot2/), which converts ggplot2 charts to interactive d3 charts with good parity. Plotly also has WebGL and 3D data visualization support. One of the Plotly developers has a very good book on using Plotly in R: https://cpsievert.github.io/plotly_book/

Here's a higher-level demo of ggplotly in one of my R Notebooks: http://minimaxir.com/notebooks/breach-network/

Shiny requires an external server and is often overkill for static data.


You can build Shiny apps in RStudio and publish them with one click to shinyapps.io. Works very similarly to publishing with Plotly, even though Shiny is a server-side package vs. client-side for Plotly.

(You can build a Plotly chart in ggplot, embed it in a web page and then script it with JS to get a visualization. Frankly, that's a PITA. You can write R/shiny code that will generate a visualization, with HTML controls etc, and you end up writing a web app in R and that's a different PITA. I would like to see Plotly generate a web wrapper that automates wiring up a plotly graph and scripting it from an app so you can update data on the fly to make it a visualization. Supposedly they are working on it with their dash framework, but it's not released yet.)


The pricing on shinyapps.io is prohibitive if the post gets any more than a trickle of page views.

The embed-directly-into-HTML is the approach I use for my Jekyll blog and it does not require much effort. (I just have to set a YAML flag to load Plotly library)


Yes, for embedding a chart and getting some basic active functionality Plotly is very easy.

The part that requires some custom Plotly coding is when you want to script the chart ... have HTML buttons, sliders, to filter, recompute, revisualize the data.

It's beautiful that it even works, and you can programmatically update the JSON of an embedded chart. But it would be nice if you could give Plotly a dataset, plot the data, and say, give me a button to filter rows using these criteria for this column (or run some other code on the data) and re-render the chart. Right now you have to code that manually and update the JSON model.

Visualization used to mean charts that were animated and/or would dynamically update but now it means any old chart LOL.



Good lord, even after all this time, ggvis' demo is still rather a disaster on mobile. Oh well, it simply isn't possible for everything to be top priority. Rstudio has done some amazing work, I'm afraid ggvis is not yet up to the standards of their other projects.


They've been busy!


This article discusses many of the options to output interactive visualizations from R.

https://www.r-bloggers.com/interactive-visualizations-with-r...

None of them are as flexible as D3, but there are packages to output from R to D3 out there.


Well D3 is always gonna be the best (downside, you're messing around in JS). However the rBokeh and plotly packages can help make interactive graphs.


htmlwidgets[0] and flexdashboard[1]. Essentially it's writing rmarkdown documents. Shiny integration is optional.

[0] http://www.htmlwidgets.org/

[1] http://rmarkdown.rstudio.com/flexdashboard/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: