Exercises: Session 1

1. Install the R package caret.

In [ ]:

2. Install the BioConductor package genefilter.

In [ ]:

3. Save the iris data set to a CSV file, and then read it back in as a data.frame called iris.1.

In [ ]:

4. Show just rows 5-10 of the iris data set.

In [ ]:

5. Simulate 10 rolls of a six-sided die - that is generate a vector of length 10 containing only numbers from 1 to 6.

In [ ]:

6. Create a data.frame with two columns

  • the column age should consist of 10 numbers from a normal distribution with mean 18 and standard deviation 1
  • the column major should be a random vector of 10 factors each of which is either statistics, mathematics or biology.
In [ ]:

7. Make a vector of 10 strings gene1, gene2, ... gene10.

In [ ]:

8. Using R’s help system, find out how to use the seq function to generate a vector of 7 numbers starting at 1 and ending at 10.

In [ ]: