In Part 13, let’s see how to create box plots in R. Let’s create a simple box plot using the boxplot() command, which is easy to use. First, we set up a vector of numbers and then we plot them.
Box plots can be created for individual variables or for variables by group (more…)

I’m sure you’ve heard that R creates beautiful graphics.
It’s true, and it doesn’t have to be hard to do so. Let’s start with a simple histogram using the hist() command, which is easy to use, but actually quite sophisticated.
First, we set up a vector of numbers and then we create a histogram.
B <- c(2, 4, 5, 7, 12, 14, 16)
hist(B)

That was easy, but you need more from your histogram. (more…)
Let’s create a simple bar chart in R using the barplot() command, which is easy to use.
First, we set up a vector of numbers. Then we count them using the table() command, and then we plot them.
The table() command creates a simple table of counts of the elements in a data set.
H <- c(2,3,3,3,4,5,5,5,5,6)
Now we count the elements using the table() command, as follows: (more…)
In Part 9, let’s look at sub-setting in R. I want to show you two approaches.
Let’s provide summary tables on the following data set of tourists from different nations, their gender and numbers of children. Copy and paste the following array into R. (more…)
Let’s look at some basic commands in R.
Set up the following vector by cutting and pasting from this document:
a <- c(3,-7,-3,-9,3,-1,2,-12, -14)
b <- c(3,7,-5, 1, 5,-6,-9,16, -8)
d <- c(1,2,3,4,5,6,7,8,9)
Now figure out what each of the following commands do. You should not need me to explain each command, but I will explain a few. (more…)
In Part 7, let’s look at further plotting in R. Try entering the following three commands together (the semi-colon allows you to place several commands on the same line).
Let’s take an example with two variables and enhance it.
X <- c(3, 4, 6, 6, 7, 8, 9, 12)
B1 <- c(4, 5, 6, 7, 17, 18, 19, 22)
B2 <- c(3, 5, 8, 10, 19, 21, 22, 26)
(more…)