Big Title

Little Title

Even Littler Title

Normal text, just perfectly normal text, nothing special here. If we want to jazz it up a bit we can use italics for example, or even bold text!

Making a list of other things we can do:

  • write equations such as \[ e = m c^2 \]
  • add url links: click here
  • do numbered lists - that are indented further
    1. like
    2. this

And tables are quite straightforward as well:

First Header Second Header Third Header
Content Cell Content Cell More stuff

OK, now for some data analysis

First let’s get some data, one of the builtin datasets will do, iris sepal lentgh is a favourite.

From the documentation: > Fisher’s or Anderson’s iris data set gives the measurements in centimeters of the variables sepal length and width and petal length and width, respectively, for 50 flowers from each of 3 species of iris. The species are Iris setosa, versicolor, and virginica.

Here is a quick look at the data set, to give you a flavour:

head(iris)
##   Sepal.Length Sepal.Width Petal.Length Petal.Width Species
## 1          5.1         3.5          1.4         0.2  setosa
## 2          4.9         3.0          1.4         0.2  setosa
## 3          4.7         3.2          1.3         0.2  setosa
## 4          4.6         3.1          1.5         0.2  setosa
## 5          5.0         3.6          1.4         0.2  setosa
## 6          5.4         3.9          1.7         0.4  setosa

Just quickly, there are is 150 cases or rows in the dataset, and the mean petal lenght is 3.758.

Simple scatterplot

Now we can explore the data visually a bit, like plotting the petal length by its width:

plot(iris$Petal.Length, iris$Petal.Width, 
     xlab=c("Petal lenght"),
     ylab=c("Petal width"),
     main="Iris Data")

Linear regression

How about a linear regression line in the chart? And colour coding the data points by species? First let’s use a linear model and see what the intercept and slope are?

lm(iris$Petal.Width ~ iris$Petal.Length )$coefficients
##       (Intercept) iris$Petal.Length 
##        -0.3630755         0.4157554

OK, not we can do the same plot as before, but add colours and the line. And because this is pretty straightforward, I won’t bore you with the code, but only show you the plot instead:

More to come…