Solution

4 plots + 4 R codes