Unit 6 - Scripts and Functions and more plotting

In this video, we review some of the ideas from earlier videos. We introduce the idea of a "script", which can be seen as a programme that we call from the R command line. We also look at user-defined functions and how we may use them to produce some graphics.


Here are some of the functions reviewed and introduced in the video;

objects()
ls()
rm(x)
rm(list=ls())
history(20)

And the second function presented in the video (renamed myfunc2):
myfunc2 <- function(x) {
if (x==1) {y <- "function not defined"; return(y) }
y <- x/(1-x)
return(y)
}

To practice with scripts, here are the codes from the video:

The Bell Curve
The two functions graphed.

© Germinal Knowledge, All rights reserved.