Updated Shiny App

[This article was first published on rstats-tips.net, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Today I’ve updated my Shiny App I wrote about a few days ago.

I’m using now Flexdashboard to embed a shiny app into an Rmarkdown-File.

Using Flexdashboard caused a little trouble when using observeEvent(). But currently the apps works, but throws a warning regarding observeEvent() in respect to plotly.

1
The 'plotly_click' event tied a source ID of 'A' is not registered. In order to obtain this event data, please add `event_register(p, 'plotly_click')` to the plot (`p`) that you wish to obtain event data from.

I don’t know how to tackle this problem. Especially because I can’t change the id of the plot. When I’m using another id as the default ‘A’ the app crashes when I click into the plotly-plot…

Viridis Colorscale for Colorblindness

I also published an app-version using the viridis colorscale instead of green-yellow-red. So colorblind people may use this version.

Personally I thinks it’s more difficult to read this scale but I’m not colorblind.

Github

I’ve pushed the source-code to github.com. So anybody who wants to play with the code can do this.

Binder

I also tried to use binder as a simple way to run the R-code in RStudio or the app. But unfortunately I can’t install the R-package geojsonio.

So you have to use your local RStudion installation and install the required packages on your own.

To leave a comment for the author, please follow the link and comment on their blog: rstats-tips.net.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)