INTRODUCTION The ggiraph is an htmlwidget and a ggplot2 extension. It allows ggplot graphics to be animated. Animation is made with ggplot geometries that can understand three arguments: Tooltip: a column of data-sets that contain tooltips to be displayed when the mouse is over elements. Onclick: a column of data-sets that contain a JavaScript function […]

## How to Plot With Ggiraph

**Please note** This tutorial is largely taken from the relevant package github page **Please note** INTRODUCTION The ggiraph is an htmlwidget and a ggplot2 extension. It allows ggplot graphics to be animated. Animation is made with ggplot geometries that can understand three arguments: Tooltip: a column of data-sets that contain tooltips to be displayed when […]

## Well-Behaved Functions – Exercises

It is said that, in R, everything that happens is a function call. So, if we want to improve our ability to make things happen the way we want them to, maybe it’s worth getting very comfortable with how functions work in R. In this exercise set, we’ll try to gain better fluency and deepen […]

## Simple Spatial Modeling – Part 1: Exercises

This exercise is an extension of the last two previous exercises about numerical modeling. They can be found here and here. Those two previous exercises are representing how the model works in a lumped system. At this time, we will try to bring a space into our model. Make sure that you look at the […]

## Parsing Dates and Time – Part 3: Exercises

In the exercises below, we will continue our work with the lubridate package to see more features of it. Answers to these exercises are available here. If you obtained a different (correct) answer than those listed on the solutions page, please feel free to post your answer as a comment on that page. Exercise 1 […]

## MCMC Using STAN – Visualization With The Shinystan Package: Exercises

This final post about the STAN platform will specifically focus on data visualizations that can come from STAN models. In particular, we will explore these visualizations by hand with the popular shinystan package. As we already know, the STAN platform typically uses particular Markov Chain Monte Carlo (MCMC) algorithms: the Hamiltonian Monte Carlo (HMC) or […]

## How to Plot With Metricsgraphics: Exercises

INTRODUCTION Metricsgraphics is an htmlwidget interface to the MetricsGraphics.js JavaScript/D3 chart library. Usage Building metricsgraphics charts follows the “piping” idiom, made popular through the magrittr, ggvis and dplyr packages. This makes it possible to avoid one giant function with a ton of parameters and facilitates, breaking out the chart and building into logical steps. While […]

## R FOR HYDROLOGISTS – Seasonality and Trend Decomposition

R FOR HYDROLOGISTS SEASONALITY AND TREND DECOMPOSITION If you don’t have the data, please first get it from the first tutorial here. Also, you need to install and load the ggplot2 package. if(!require(ggplot2)){install.packages(ggplot2, dep=T)} Answers to these exercises are available here. Time series decomposition is a mathematical procedure which transforms a time series into multiple different […]

## Applied Economic Analysis With R – Part 1: Exercises

R has great potential in Economic data analysis, as well as econometrics. In this set of exercises, we will go through a wide variety of topics in econometrics, including wage equations, growth regressions, dynamic regressions and time series models, hedonic regressions, the demand for health care, and labor force participation. In the first set of […]

## How to Plot With Metricsgraphics

Introduction to Metricsgraphics Metricsgraphics is an htmlwidget interface to the MetricsGraphics.js JavaScript/D3 chart library. **Please note** This tutorial is largely taken from the relevant package github page **Please note** Installation devtools::install_github(“hrbrmstr/metricsgraphics”) Usage Building metricsgraphics charts follows the “piping” idiom, made popular through the magrittr, ggvis and dplyr packages. This makes it possible to avoid one […]