## Introduction to R
## R is a calculator
2 + 3
## You can create variables in R
x <- 7.3
y <- pi
print(y, digits = 15)
## R can be used as an object oriented language
## This means all objects have classes
## and methods can be written for each class
class(x)
x <- 1:20
y <- x * 3 + rnorm(20, sd = 2)
xyplot(y ~ x)
fit <- lm(y ~ x)
fit
class(fit)
names(fit)
summary(fit)