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 […]
Exercises (intermediate)
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 […]
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 […]
Specalize in Geo-Spatial Visualizations With Leaflet – Part 1: Exercises
Leaflet is a JavaScript library for interactive maps. It is widely used across many platforms, and fortunately it is also implemented as a very user-friendly R package! With leaflet, you can create amazing maps within minutes that are customized exactly to your needs and embed them within your Shiny apps, markdowns, or just view them […]
Harvesting Data From the Web With Rvest: Exercises
The rvest package allows for simple and convenient extraction of data from the web into R, which is often called “web scraping.” Web scraping is a basic and important skill that every data analyst should master. You’ll often see it as a job requirement. In the following exercises, you will practice your scraping skills on […]
Basic Generalized Additive Models In Ecology: Exercises
Generalized Additive Models (GAM) are non-parametric models that add smoother to the data. In this exercise, we will look at GAMs using cubic spline using the mgcv package. Data-sets used can be downloaded here. The data-set is the experiment result of grassland richness over time in the Yellowstone National Park (Skkink et al. 2007). […]
Melt and Cast The Shape of Your Data-Frame: Exercises
Data-sets often arrive to us in a form that is different from what we need for our modeling or visualization functions, which, in turn, don’t necessarily require the same format. Reshaping data.frames is a step that all analysts need, but many struggle with. Practicing this meta-skill will, in the long-run, result in more time to […]
Non-Linear Models in R: Exercises
A mechanistic model for the relationship between x and y sometimes needs parameter estimation. When model linearisation does not work,we need to use non-linear modeling. There are three main differences between non-linear and linear modeling in R: 1. Specify the exact nature of the equation. 2. Replace the lm() with nls(), which means non-linear least […]
Intro To Time Series Analysis – Part 2: Exercises
In the exercises below, we will explore more in the Time Series analysis. The previous exercise can be found here. Please follow this in sequence. Answers to these exercises are available here. Exercise 1 Load the AirPassengers data. Check its class and see the start and end of the series. Exercise 2 Check the cycle of […]
Sharpening the Knives in the data.table Toolbox: Exercises
If knowledge is power, then knowledge of data.table is something of a super power, at least in the realm of data manipulation in R. In this exercise set, we will use some of the more obscure functions from the data.table package. The solutions will use set(), inrange(), chmatch(), uniqueN(), tstrsplit(), rowid(), shift(), copy(), address(), setnames() […]









