I've been playing around with using #WebR and #Quarto for client-side interactive lesson material and it's amazing! All the R code (including #TidyVerse 📦) is running in the user's browser, so no server setup, resources, or security to worry about.

Demo Website: https://interactive-lessons.weecology.org/
GitHub: https://github.com/ethanwhite/datacarp-interactive

Huge thanks to @hrbrmstr for sharing all of this awesomeness this week(end). Checkout his new blog post on this: https://rud.is/b/2023/03/12/almost-bare-bones-webr-starter-app/

#OER #rstats

Interactive Data Lessons - Experimental interactive version of Data Carpentry for Biologists

@ethanwhite

Pretty impressive! I have tried your code and run that locally, but it takes longer to install dplyr and readr that what I can experience on your website.

In you code setup, you install these libraries. Is the installation (using js) occurring every time the page is loaded?

@philmassicotte Thanks!

1. The speed difference is due to setting two http headers. See https://docs.r-wasm.org/webr/latest/serving.html
2. Yes, the install is happening on every page load. I don't know enough yet to know if it's possible to make things more persistent. Maybe @gws can tell us whether there's a way to do this

WebR - R in the Browser - Serving Pages with WebR

@ethanwhite

Thanks for your answer. I tried this and it works fine. Thank you again for the demo!

@philmassicotte I'm glad it's useful!

I'm not actually sure that I was right about (2). Once I stopped changing the site reloads seem to be a lot quicker, so webR may actually be caching those installs.

@ethanwhite

Cool I will do some test on my side. Do I have to set up these two header things only locally, or will it be ok if hosted on github-pages or Netlify?

@philmassicotte You need to add them on the host as well. Instructions for netlify on the my blog post on this that just when live https://jabberwocky.weecology.org/2023/03/13/a-brief-introduction-to-using-webr-and-quarto-for-client-side-interactive-lesson-material/

@hrbrmstr had a post yesterday about getting things working on GH pages https://mastodon.social/@hrbrmstr/110011327969591021

A brief introduction to using WebR and Quarto for client-side interactive lesson material

Jabberwocky Ecology

@ethanwhite @hrbrmstr

Thanks, this is very cool. A new toy to play with :)