📣 Announcing Dash for R

:sparkles: :mega: Introducing Dash for R

Hello Dash Community! I’m excited to announce the arrival of Dash … for R users! We’re bringing the power, productivity and features of this highly extensible, developer-friendly framework to the R community. You can find our Medium post here: https://medium.com/@plotlygraphs/announcing-dash-for-r-82dce99bae13

The API and syntax are extremely similar to Dash for Python, so it’s exceptionally easy to get started writing R apps or porting your existing projects if you’re already familiar with Dash.

We’ve been hard at work on this project for several months; all the component libraries you know and love from Dash for Python are now available for R as well:

  • Dash Core Components
  • Dash HTML Components
  • Dash Table
  • Dash Design Kit
  • Dash Bio
  • Dash Canvas
  • Dash Cytoscape
  • Dash DAQ

In addition, R developers will enjoy the same in-browser debugging and callback graphing experience as Dash for Python users with support for Dash Dev Tools:

For Dash Enterprise customers, app developers will especially appreciate support for Dash Design Kit in R, which makes styling and theming your apps a breeze :sailboat: :relieved:

To see Dash for R in action, please visit our recently updated Dash gallery, which now includes over 25 of our sample apps rewritten in R!

https://dash-gallery.plotly.host/Portal/

And don’t forget to check out our extensive, interactive online R documentation, with plenty of helpful examples to get you started quickly making sophisticated, stylish apps with Dash:

https://dashr.plot.ly

We’re in the process of publishing the package on CRAN, but for now you can install using the install_github function which is available after loading the devtools package:

library(devtools)
install_github('plotly/dash-html-components') # HTML components
install_github('plotly/dash-core-components') # Supercharged core UI components
install_github('plotly/dashR') # The core dash backend

Please check out Dash for R and tell us what you think! We can’t wait to see your apps in our Dash Show and Tell forum: Show and Tell - Community Thread 🎉

…and don’t hesitate to get in touch if you have questions or suggestions! :slight_smile:

– Ryan (Dash for R lead developer)

7 Likes

Hi there

looks very interesting, something to consider to use in some cases when Shiny may be an overkill.

Do you have any tutorial of setting up it on a web server and making apps available for public?

Hi Alex!

It’s possible to deploy Dash for R apps using either Dash Enterprise or Heroku; for the latter, there are some notes in the Deployment section of the docs:

https://dashr.plot.ly/deployment

Cheers,
Ryan

Hi Ryan

thanks for reference.

Is there anything for AWS deployment?

@chriddyp @rpkyle The Dash R documentation seems to be down right now. I get this error: ERROR: 'names' attribute [9] must be the same length as the vector [8]

Hi Rafael,

I’m sorry you’ve run into trouble. Could you try clearing your browser cache and revisiting the page? I think it should load properly afterwards; please let me know if this isn’t the case.

Cheers,
Ryan

Hi Alex,

I think this reference might be useful — some of the material is applicable to Shiny users, but if you follow the guide and modify the configuration to install Dash for R, it might do the trick:

https://aws.amazon.com/blogs/big-data/running-r-on-aws/

Cheers,
Ryan

Thanks, that worked!

Hi Rafael,

We recently merged PR #122 which addressed a cookie-parsing bug in the reqres package (upon which the dash package depends); I believe this should prevent the error from occurring, but if you (or anyone else) encounters it again, please let us know.

Cheers,
Ryan

1 Like

@rpkyle
Have been using Dash for python and trying to get Dash for R up and running, but having issues with package installation. Namely in finding the actual dash library to install. Using the instructions here https://dashr.plot.ly/installation which appears to install the components but not dash itself. (I get the following error in R Studio: Error in library(dash) : there is no package called ‘dash’)

Where can I find the actual dash library? Also - is it indeed the regres (1 s) package and not the regress (2 s) package that is required? If so, I need instructions for finding that as well.

Thanks!
Lissa

Hi Lissa!

Thanks for mentioning this, and I’m sorry you’ve run into trouble. We’re close to an initial CRAN release, but for now you can obtain the current version using the following instructions:

library(devtools)
install_github("plotly/dashR", upgrade = TRUE)

If you’d like to try out the current development version (which is stable, and offers hot reloading and RStudio viewer support among other neat new features – and is essentially the CRAN pre-release), you can try instead

library(devtools)
install_github("plotly/dashR", ref="dev", upgrade = TRUE)

In the meantime, I’ll clarify our installation instructions in the online docs so that this doesn’t happen again.

Finally, the required package that you need is actually called “reqres”; it should be fetched automatically when you attempt to install Dash for R.

I hope this helps, but please don’t hesitate to get in touch if you still have trouble…or just want to share your experience with Dash for R :smiley:

Cheers,
Ryan

@rpkyle - This is what I’ve been doing, and just tried with the dev version, and still getting the “Error in library(dash) : there is no package called ‘dash’” message. The Core components, html and datatable packages all install, but the dash package is MIA.

FWIW am using RStudio on a Dell with Windows 10 Home edition. Just looked in Program Files and apparently have both R 3.5.3 and 3.5.1 installed, in case that’s the issue.

Checked my directories and the install was into my personal library (vs the program library), and the other stated packages are there, I just don’t have dash. So I think I need to install it separately?

I think I understand what’s happening here – it’s not necessary to install the component libraries individually, since the core requirements (dashCoreComponents, dashHtmlComponents, and dashTable) will automatically download and install when you fetch the dash package.

The important detail is to specify upgrade=TRUE and install only the dash package, like this:

library(devtools)
install_github("plotly/dashR", upgrade = TRUE)

This is necessary because the core component libraries are version-locked to a specific release of Dash for R, as in Dash for Python.

If it still doesn’t work, if you don’t mind copying and pasting the complete install output from your session into this thread, I’m sure we can sort it out. (I just tested the install instructions again, and they worked for me, now we just need to get them working for you too!)

I haven’t been loading them individually - just went looking to see what had actually been installed when it didn’t work. Here’s the output from my most recent attempt. This ‘digest’ package error is a new one. (Have had similar errors for other packages and have manually installed those.)


library(devtools)
install_github(“plotly/dashR”, upgrade = TRUE)
Downloading GitHub repo plotly/dashR@master
reqres (0.2.3 -> 55072abfb…) [GitHub]
curl (NA -> 4.2 ) [CRAN]
data.table (1.12.2 -> 1.12.6 ) [CRAN]
digest (0.6.18 -> 0.6.22 ) [CRAN]
dplyr (0.8.0.1 -> 0.8.3 ) [CRAN]
fastmap (NA -> 1.0.1 ) [CRAN]
ggplot2 (3.1.1 -> 3.2.1 ) [CRAN]
hexbin (1.27.2 -> 1.27.3 ) [CRAN]
htmlwidgets (1.3 -> 1.5.1 ) [CRAN]
httpuv (1.5.1 -> 1.5.2 ) [CRAN]
httr (1.4.0 -> 1.4.1 ) [CRAN]
later (0.8.0 -> 1.0.0 ) [CRAN]
lifecycle (NA -> 0.1.0 ) [CRAN]
openssl (1.3 -> 1.4.1 ) [CRAN]
pkgconfig (2.0.2 -> 2.0.3 ) [CRAN]
promises (1.0.1 -> 1.1.0 ) [CRAN]
purrr (0.3.2 -> 0.3.3 ) [CRAN]
Rcpp (1.0.1 -> 1.0.3 ) [CRAN]
rlang (0.4.0 -> 0.4.1 ) [CRAN]
shiny (1.2.0 -> 1.4.0 ) [CRAN]
sys (3.1 -> 3.3 ) [CRAN]
tibble (2.1.1 -> 2.1.3 ) [CRAN]
tidyr (0.8.3 -> 1.0.0 ) [CRAN]
xml2 (1.2.0 -> 1.2.2 ) [CRAN]
xtable (1.8-3 -> 1.8-4 ) [CRAN]
Installing 24 packages: curl, data.table, digest, dplyr, fastmap, ggplot2, hexbin, htmlwidgets, httpuv, httr, later, lifecycle, openssl, pkgconfig, promises, purrr, Rcpp, rlang, shiny, sys, tibble, tidyr, xml2, xtable
Installing packages into '[redacted]/R/win-library/3.5’
(as ‘lib’ is unspecified)

There is a binary version available but the source version is later:
binary source needs_compilation
Rcpp 1.0.2 1.0.3 TRUE

Binaries will be installed
trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/curl_4.2.zip
Content type ‘application/zip’ length 4121645 bytes (3.9 MB)
downloaded 3.9 MB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/data.table_1.12.6.zip
Content type ‘application/zip’ length 2248539 bytes (2.1 MB)
downloaded 2.1 MB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/digest_0.6.22.zip
Content type ‘application/zip’ length 241811 bytes (236 KB)
downloaded 236 KB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/dplyr_0.8.3.zip
Content type ‘application/zip’ length 3255045 bytes (3.1 MB)
downloaded 3.1 MB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/fastmap_1.0.1.zip
Content type ‘application/zip’ length 413143 bytes (403 KB)
downloaded 403 KB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/ggplot2_3.2.1.zip
Content type ‘application/zip’ length 3960417 bytes (3.8 MB)
downloaded 3.8 MB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/hexbin_1.27.3.zip
Content type ‘application/zip’ length 932268 bytes (910 KB)
downloaded 910 KB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/htmlwidgets_1.5.1.zip
Content type ‘application/zip’ length 808856 bytes (789 KB)
downloaded 789 KB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/httpuv_1.5.2.zip
Content type ‘application/zip’ length 1507395 bytes (1.4 MB)
downloaded 1.4 MB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/httr_1.4.1.zip
Content type ‘application/zip’ length 508656 bytes (496 KB)
downloaded 496 KB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/later_1.0.0.zip
Content type ‘application/zip’ length 661041 bytes (645 KB)
downloaded 645 KB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/lifecycle_0.1.0.zip
Content type ‘application/zip’ length 84198 bytes (82 KB)
downloaded 82 KB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/openssl_1.4.1.zip
Content type ‘application/zip’ length 3968626 bytes (3.8 MB)
downloaded 3.8 MB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/pkgconfig_2.0.3.zip
Content type ‘application/zip’ length 22163 bytes (21 KB)
downloaded 21 KB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/promises_1.1.0.zip
Content type ‘application/zip’ length 1780396 bytes (1.7 MB)
downloaded 1.7 MB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/purrr_0.3.3.zip
Content type ‘application/zip’ length 421796 bytes (411 KB)
downloaded 411 KB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/Rcpp_1.0.2.zip
Content type ‘application/zip’ length 4551070 bytes (4.3 MB)
downloaded 4.3 MB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/rlang_0.4.1.zip
Content type ‘application/zip’ length 1093427 bytes (1.0 MB)
downloaded 1.0 MB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/shiny_1.4.0.zip
Content type ‘application/zip’ length 4913441 bytes (4.7 MB)
downloaded 4.7 MB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/sys_3.3.zip
Content type ‘application/zip’ length 59546 bytes (58 KB)
downloaded 58 KB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/tibble_2.1.3.zip
Content type ‘application/zip’ length 334051 bytes (326 KB)
downloaded 326 KB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/tidyr_1.0.0.zip
Content type ‘application/zip’ length 1292752 bytes (1.2 MB)
downloaded 1.2 MB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/xml2_1.2.2.zip
Content type ‘application/zip’ length 3501406 bytes (3.3 MB)
downloaded 3.3 MB

trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.5/xtable_1.8-4.zip
Content type ‘application/zip’ length 704757 bytes (688 KB)
downloaded 688 KB

package ‘curl’ successfully unpacked and MD5 sums checked
package ‘data.table’ successfully unpacked and MD5 sums checked
package ‘digest’ successfully unpacked and MD5 sums checked
Error: (converted from warning) cannot remove prior installation of package ‘digest’

Update: I created a new library and did a fresh install there and it appears to have loaded there. So there must have been a conflict with one of my previously installed packages, though I have no idea which one.

I’m glad it eventually worked (I was just preparing a DM to follow up) – package conflicts are often tricky to sort out.

If you run into additional problems, please don’t hesitate to let us know.

Cheers,
Ryan

three reasons why you should buy plotly pro: support open source, get great support, host your plots and dashboards online