Home > IB.542.code

IB.542.code

IB.542.code is a project mainly written in R, it's free.

functions for modeling climate with [R]

IB 542 - Climate Modeling Functions

About These Files

In working through learning to use the equations, in (Campbell & Norman, 1998), I am coding them as functions in R. I thought it would be handy, if I could share these with you. To go with this, I have included a file called learn.R to work you through much of the introductory to programming with R, specifically in the context of a temperature record data set.

  • learn.R. - a script you can work through to learn using R
  • run.model.R. - a bare bones script for running functions learned about in learn.R

data

  • 2010.SoyFace.micromet.sample.csv 10 days of temperature record (Ta - Airtemp and Ts - Tsoil)
  • CSV download link

functions

  • model.Functions.R contains functions we will use

You will need to download the files and open them in the R software

Download this directory by clicking the "Download Source" link at the top of the page

Get R up and going on your computer

You will need to download and install one of the following packages

  • R for Mac OS X.
  • R for Windows.

Run the program

  • the following screenshots were taken on OS X, Windows is a bit different, but the premise is the same

This is the console

The angle bracket > is the cursor prompt where you input commands

sequence of numbers

Open learn.R in the R software

Previous:raphael-gwt