## graphics_practical.R
## Oliver Davis 19.06.12
##############################
## Exercises ##
##############################
## 1) One of the really useful datasets that comes with R is stopping distances
## for 1920s cars.
?cars
## Plot a graph of stopping distance as a function of speed.
## Can you change the graphical parameters to make your graph match this version?
## Or can you improve on it?
browseURL("http://rcourse.iop.kcl.ac.uk/2012/2tue/session3/cars.pdf")
## Useful help pages include
?plot.default
## and
?par
## Have a go with changing parameters and see what they do!
## You might consider looking up pch, las, bty, xlab, ylab, xlim, col and main.
## 2) Now you're having so much fun with R, you're considering painting your
## sitting room in one of R's named colours
colours()
## But what you really need is a colour chart so you can match the walls
## to your curtains, like this:
browseURL("http://rcourse.iop.kcl.ac.uk/2012/2tue/session3/colour_chart.pdf")
## How would you use R as a canvas to generate your own take-home colour chart?
## Hints: you can do it using only functions we met during this session;
?rep
## may also come in useful.
## 3) Here are some text files downloaded from Ensembl and HapMap:
## SNPs from chromosome 22, with associated p values
browseURL("http://rcourse.iop.kcl.ac.uk/S4/snps.txt")
## Genes from Ensembl
browseURL("http://rcourse.iop.kcl.ac.uk/S4/genes.txt")
## Recombination rate data from HapMap
browseURL("http://rcourse.iop.kcl.ac.uk/S4/recombination.txt")
## As a look ahead to tomorrow's programming sessions, how would you use this data to
## make this graph?
browseURL("http://rcourse.iop.kcl.ac.uk/2012/2tue/session3/associationPlot.pdf")