Full Stack with R

How to do ‘Full Stack Web Development’ with R

Kyle Tolliver
03-26-2021

This page is a tutorial of what packages and tools could be used to mimic Full Stack Web Development with R.

Tidyverse

Basic Commands

install.package("tidyverse")
library(tidyverse)

Tidyverse is a collection of useful packages for Data Science. I believe its no mater what you use R for.

Packages include:

See https://www.tidyverse.org/ for more information

Pacman

Basic Commands

install.package("pacman")
library(pacman)

The pacman package is an R package management tool that combines the functionality of base library related functions into intuitively named functions.

pacman Function Base Equivalent Description
p_load install.packages + library Load and Install Packages
p_install install.packages Install Packages from CRAN
p_load_gh NONE Load and Install GitHub Packages
p_install_gh NONE Install Packages from GitHub
p_install_version install.packages & packageVersion Install Minimum Version of Packages
p_temp NONE Install a Package Temporarily
p_unload detach Unload Packages from the Search Path
p_update update.packages Update Out-of-Date Packages

See https://rdocumentation.org/packages/pacman/versions/0.5.1 for more information

Googlesheets4

Basic Commands

install.package("googlesheets4")
library(googlesheets4)

googlesheets4 will, by default, help you interact with Sheets as an authenticated Google user.

Use gs4_deauth() to indicate there is no need for a token

Similar Packages include:

See https://googlesheets4.tidyverse.org/ for more information

RMarkdown and Knitr

Basic Commands

install.package("rmarkdown")
library(rmarkdown)

Basic Commands

install.package("knitr")
library(knitr)

Allows for flexiblity of files and functions when converting to html.

See https://rmarkdown.rstudio.com/, https://www.rdocumentation.org/packages/knitr/versions/1.31 for more information

Pander and Glue

Pander

Basic Commands

install.package("pander")
library(pander)

Prints an R object in Pandoc’s markdown. Used to beautify output in R.

See https://www.rdocumentation.org/packages/pander/versions/0.6.3 for more information

Glue

Basic Commands

install.package("glue")
library(glue)

Glue offers interpreted string literals that are small, fast, and dependency-free. Glue does this by embedding R expressions in curly braces which are then evaluated and inserted into the argument string.

Basic Functions

glue()
glue_data()
glue_sql()

See https://glue.tidyverse.org/ for more information

Pander and Glue together

Allow for reuse of print statements.

For example info <- function(url){pander(glue("See [{url}]({url}) for more information")) was used in this page and I just inserted the url into the function call.

SQL Packages

SQL - database query language – a language designed specifically for interacting with a database

These packages allow you to run SQL commands in R.

See https://dept.stat.lsa.umich.edu/~jerrick/courses/stat701/notes/sql.html for more information

Jsonlite and V8

The jsonlite package is a JSON parser/generator optimized for the web. See https://cran.r-project.org/web/packages/jsonlite/vignettes/json-aaquickstart.html for more information

V8 is Google’s open source, high performance JavaScript engine. V8 R package allows you implement JS in R. See https://cran.r-project.org/web/packages/V8/vignettes/v8_intro.html for more information

ReactR

reactR provides a set of convenience functions for using React in R with htmlwidget constructor templates and local JavaScript dependencies. The React ecosystem is rich with components that can enhance R web and Shiny apps.

Learn ReactJS at https://www.w3schools.com/react/default.asp

See https://react-r.github.io/reactR/ for more information

Shiny

Shiny is an R package that makes it easy to build interactive web apps straight from R. You can host standalone apps on a webpage or embed them in R Markdown documents or build dashboards.

See https://shiny.rstudio.com/ for more information

Other

Citation

For attribution, please cite this work as

Tolliver (2021, March 26). Tolli-Coding: Full Stack with R. Retrieved from https://tolli-coding.netlify.app/posts/2021-03-26-full-stack-r/

BibTeX citation

@misc{tolliver2021full,
  author = {Tolliver, Kyle},
  title = {Tolli-Coding: Full Stack with R},
  url = {https://tolli-coding.netlify.app/posts/2021-03-26-full-stack-r/},
  year = {2021}
}