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 […]
Exercises
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 […]
How To Create a Flexdashboard: Exercises
INTRODUCTION With flexdashboard, you can easily create interactive dashboards for R. What is amazing about it is that with R Markdown, you can publish a group of related data visualizations as a dashboard. Additionally, it supports a wide variety of components, including htmlwidgets; base, lattice, and grid graphics; tabular data; gauges and value boxes […]
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() […]
Polynomial Model in R – Study Case: Exercises
It is pretty rare to find something that represents linearity in the environmental system. The Y/X response may not be a straight line, but humped, asymptotic, sigmoidal or polynomial are possibly, truly non-linear. In this exercise, we will try to take a closer look at how polynomial regression works and practice with a study case. […]
Intro To Time Series Analysis – Part 1: Exercises
In the exercises below, we will work with Time Series analysis and see how R can make your life easier when working with Time Series. This will be a series of Exercises and I urge you to take it in series. Please install the package and load the library before starting. Answers to these exercises […]
How To Plot With Patchwork: Exercises
INTRODUCTION The goal of patchwork is to make it simple to combine separate ggplots into the same graphic. It tries to solve the same problem as gridExtra::grid.arrange() and cowplot::plot_grid, but using an API that incites exploration and iteration. Before proceeding, please follow our short tutorial. Look at the examples given and try to understand the […]
Programmatically Creating Text Outputs in R: Exercises
In the age of Rmarkdown and Shiny, or when making any custom output from your data, you want your output to look consistent and neat. Also, when writing your output, you often want it to obtain a specific (decorative) format defined by the html or LaTeX engine. These exercises are an opportunity to refresh our […]
Simple Spatial Modeling – Part 3: Exercises
So far, we have learned how to count spatial variability in our model. Please look at these two previous exercises here and here if you haven’t tried it yet. However, it only represents 1-Dimension models. In this exercise, we will try to expand our spatial consideration into a 2-Dimension model. Have a look at this […]
Intro to FFTree: Exercises
In the exercises below, we will work with the FFTree package, which allows us to use fast and frugal decision trees to model data. Please install the package and load the library before starting. Answers to these exercises are available here. If you obtained a different (correct) answer than those listed on the solutions page, […]