- Optional Extras
We're going to use RStudio Desktop in this workshop. Yes, you can even do web development work in RStudio!
# install.package("devtools") devtools::install_github("gadenbuie/js4shiny", dependencies = TRUE)
Be sure to include the
dependencies = TRUE!
rmarkdown limited specifically to version 2.0. If you have
rmarkdown 2.0 installed, I recommend updating to a newer version. The current version of
rmarkdown on CRAN is . If the CRAN version is 2.0.5 or higher, install from CRAN; otherwise use
I've created a set of code snippets for RStudio that are useful for the types of tasks we'll cover in the workshop. You can find them in the js4shiny repo in inst/snippets.
To install, you can use the js4shiny package.
You cou an manually install the snippets by copying them from here and pasting them into the snippets editor in RStudio, which is available under Global Options > Code > Edit Snippets button. You can find more information and detailed instructions about using snippets at Code Snippets on the RStudio Support page.
Other R Requirements
I've included all of the packages that we'll need
in the dependencies of
except for the tidyverse.
Please make sure you have at least the core tidyverse packages installed.
The final R detail is that we will be building a package during the workshop when we create an htmlwidget. We won't focus on the mechanics of package building in the workshop. If you're not familiar with package development, I recommend taking a look a R Packages by Hadley Wickham and Jenny Bryan. At a minimum, please review the System Setup chapter, in particular the section on the R build toolchain to ensure that your laptop will be ready to build a package.
We'll spend a significant amount of time using a web browser, and it's important to use a browser with good developer tools, such as Firefox or Chrome. Safari and Internet Explorer have usable developer tools but they are generally not as developer friendly as Firefox or Chrome's developer features.
Node and npm
Check that the installation worked by running the following in a new terminal window or session.
These are the versions currently installed on my system and the version on your system may not perfectly match the version you see above. If you already have a previous, older version of Node installed, it's probably a good idea to take this opportunity to upgrade.
you can post your troubles and get help in this issue.
Node Version Manager
If you plan to do a lot of development with
you may want to use a Node Version Manager.
nvm is a bash script for macOS or Linux systems
nvm-windows is a similar program for Windows users.
The node version manager is used to manage the installation and activation
of multiple versions of
node on the same system.
Follow the instructions on the
npm (they come together)
and confirm that your installation is working.
npm install standard --global
Visual Studio Code
The primary benefit of using VSCode is that web development languages are first-class citizens, which means that the editor's interface provides helpful autocompletion and links to help documentation. Furthermore, there is a wide variety of community-contributed extensions that augment VSCode's capabilities.
A few extensions that I've found personally helpful include
- Visual Studio IntelliCode
- Live Server
- Debugger for Firefox
- VSCode Icons
- Bracket Pair Colorizer
- CSS Extensions
- HTML Extensions
VSCode and RStudio are somewhat at opposite sides of the spectrum: RStudio excels at supporting R developers while providing a reasonable editing experience for web developers; while on the other hand VSCode is excellent for the latter but less supportive of R developers.
There are a pair of extensions for R language support that are very helpful: