Menu


R Code for Climate Mathematics


1. Download the R code for the entire book for either RStudio or R console: Version 1.0, July 2019

Steps To Download:

(i) Right Click on the Download link
(ii) Select "Save link as"
(iii) Choose your destination folder and click OK
(iv) To run the code completely, you also need to download the data.zip file. Unzip the file to obtain the data folder, which contains all the datasets needed to run the R code. You also need to place the data folder in your working directory, which may be named climmath. Accordingly, you need to enter your correct working directory path in your R code, e.g., setwd("/Users/sshen/climmath").

2. Another way to download: Download the .zip R code for the entire book: Version 1.0, July 2019.

Steps To Download:

(i) Right Click on the Download link
(ii) Go to the Downloads folder to find the file named RCodes.R.zip
(iii) Unzip the RCodes.R.zip file to obtain the Rcodes.R file for RStudio or R console
(iv) To run the code completely, you also need to download the data.zip file. Unzip the file to obtain the data folder, which contains all the datasets needed to run the R code. You also need to place the data folder in your working directory, which may be named climmath. Accordingly, you need to enter your correct working directory path in your R code, e.g., setwd("/Users/sshen/climmath").

3. Chapter-by-Chapter R Code: Version 2.0, June 2022
Chapter 1: Dimensional Analysis for Climate Science: This chapter has no code.
Chapter 2: Basics of R Programming
Chapter 3: Basic Statistical Methods for Climate Data Analysis
Chapter 4: Climate Data Matrices and Linear Algebra
Chapter 5: Energy Balance Models for Climate
Chapter 6: Calculus Applications to Climate Science I: Derivatives
Chapter 7: Calculus Applications to Climate Science II: Integrals: This chapter has no code.
Chapter 8: Conservation Laws in Climate Dynamics: This chapter has no code.
Chapter 9: R Graphics for Climate Science
Chapter 10: Advanced R Analysis and Plotting: EOFs, Trends, and Global Data
Chapter 11: R Analysis of Incomplete Climate Data

4. Chapter-by-Chapter R Mark Down (.Rmd) Files Download: Version 2.0, June 2022
Chapter 1: Dimensional Analysis for Climate Science: This chapter has no code.
Chapter 2: Basics of R Programming
Chapter 3: Basic Statistical Methods for Climate Data Analysis
Chapter 4: Climate Data Matrices and Linear Algebra
Chapter 5: Energy Balance Models for Climate
Chapter 6: Calculus Applications to Climate Science I: Derivatives
Chapter 7: Calculus Applications to Climate Science II: Integrals: This chapter has no code.
Chapter 8: Conservation Laws in Climate Dynamics: This chapter has no code.
Chapter 9: R Graphics for Climate Science
Chapter 10: Advanced R Analysis and Plotting: EOFs, Trends, and Global Data
Chapter 11: R Analysis of Incomplete Climate Data


Citation: Shen, S.S.P., and R.C.J. Somerville, 2019: Climate Mathematics: Theory and Applications,
               Cambridge University Press, Cambridge, United Kingdom, 391pp.