1. Administrative stuff. Adding, rerequisites, etc. The syllabus. The good and bad things about this course, the book, and my teaching. Read ch. 1-4. 2. R Cookbook. Downloading and installing R. Any platform. Discuss R. Table 1-1. Up arrow and down arrow are useful. q(). help() and example() are useful. help.search("adf.test"). help(adf.test) said "no documentation for 'adf.test'". The book says "The problem is that the function's package is not currently loaded." library() install.packages("spatial") library(spatial) The top of p27 gives a simple example of a function. f <- function(n,p) sqrt(p*(1-p)/n) print(matrix(c(1,2,3,4),2,2). c means combine. x = c("fee", "fie", "foe", "fum"). print("The zero occurs at", 2*pi, "radians.") yields an error: unimplemented type. cat() is useful. Use \n for a new line. x <- 3. Most people use x = 3 these days. x <<- 3 makes it a global variable. That's interesting. ca = function(b){x <<- 3; x*b} x = 2 x ca(4) x x x[x=3] 1:5[is.na(y)] ## this does the wrong thing and gives you a warning. [1] 1 2 3 4 5