ABSTRACT
This chapter introduces the basic principles of the R language and RStudio to analyse and visualise data. Writing code is not only about using the correct syntax and the appropriate functions; this chapter also covers some issues regarding styling your code, making it easy to understand. This chapter concludes with a case study to measure water flow in an open channel using the Kindsvater-Carter formula. The learning objectives for this chapter are:
Install R and RStudio and identify the different parts of the RStudio screen.
Understand the principles of writing code to analyse data.
Apply R code to solve a simple water problem.