If you have any basic experience with R, you probably noticed that R uses three dots ellipsis (…) to allow functions to take arguments that weren’t pre-defined or hard-coded when the function was built. Even though R beginners are usually aware of this behavior, especially due to some common functions that implement it (for example, […]
Modularize your Shiny Apps: Solutions
[emaillocker]Below are the solutions to these exercises on Shiny modules. # load package library(shiny) #################### # # # Exercise 1 # # # #################### q1_module_UI <- function(id) { ns <- NS(id) selectInput( inputId = ns(“letter”), label = “Select a letter”, choices = LETTERS ) } #################### # # # Exercise 2 # # # #################### […]
Modularize your Shiny Apps: Exercises
Shiny modules are short (well, usually short) server and UI functions, that can be connected to each other by a common namespace, and be embedded within a regular Shiny app. You can’t run a Shiny module without a parent Shiny app. The modules can contain both inputs and outputs, and are usually centered around a […]
Prettify your Shiny Tables with DT: Exercises
Have you ever wanted to make your Shiny tables interactive, more functional and look better? The DT package, which stands for “DataTables”, provides an R interface to the JavaScript library “DataTables”. It allows creating high standard tables by implementing the functionalities and design features that are available through the “DataTables” library. Even though the DT […]
Prettify your Shiny Tables with DT: Solutions
[emaillocker]Below are the solutions to these exercises on the DT package. # load packages library(shiny) library(DT) # Each exercises should result in a Shiny app, # where the changing part is the renderDataTable() function. # To save time, you can use the following template, # and just replace the <renderDataTable> placeholder for each exercise. # […]
Pull the Right Strings with stringr: Exercises
By providing a set of wrappers to existing functions, the stringr package allows for simple, consistent and efficient manipulations of strings in R. Even though there are some more basic packages that offer strings-related functions, you might find yourself in need for a more complete and straightforward solution for handling strings in R. With a […]
Pull the Right Strings with stringr: Solutions
[emaillocker]Below are the solutions to these exercises on stringr. # load package library(stringr) # prepare the exercises data addresses <- c(“14 Pine Street, Los Angeles”, “152 Redwood Street, Seattle”, “8 Washington Boulevard, New York”) products <- c(“TV “, ” laptop”, “portable charger”, “Wireless Keybord”, ” HeadPhones “) long_sentences <- stringr::sentences[1:10] field_names <- c(“order_number”, “order_date”, “customer_email”, […]
Automating and Scheduling R Scripts in Windows: Tutorial
This tutorial will teach you how to run and schedule R scripts from the command line. Even though parts of this tutorial applies for other operating systems as well, the focus will be on Windows, since it is a bit less straightforward than in other systems. By the end of this tutorial, you will have […]
Step Up Your Dashboard With Shinydashboard – Part 2: Solutions
[emaillocker] Below are the solutions to these exercises on the “Shinydashboard Package – Part 2.” # load packages library(shiny) library(shinydashboard) ################################## # # # Basic Code to Start With # # # ################################## header <- dashboardHeader( title = span( “Practicing shinydashboard”, style = “font-family: Tahoma; font-weight: bold” ), titleWidth = “300px” ) sidebar <- dashboardSidebar( […]
Step Up Your Dashboard With Shinydashboard – Part 2: Exercises
The shinydashboard provides a well-designed dashboard theme for Shiny apps and allows for an easy assembly of a dashboard from a couple of basic building blocks. The package is widely used in commercial environments as well due to its neat features for building convenient and robust layouts. This exercise set will help you practice all […]





