Introduction to Biological Data Analysis


TP 3: Graphics and data.frames

Prof. Patrick Meyer

BioSys Lab - Université de Liège

Simple graphics

Using the functions data(),pairs(), plot(), lines(),
title(), pdf() et dev.off()
Charger le dataset CO2 et
  1. Analyze graphically the linear relations between all the pairs of variables among $Type, $Treatment,$conc et $uptake.
  2. Using the plot function, re-draw the most striking linear relationship among those drawn in the previous question.
  3. Add manually the diagonal of the graph, dotted and green, add also in black a meaningful title.
  4. Save the graph in a .pdf and check the obtained results.

data.frame

Using the functions write.table(), read.table(), intersect(), which() et which.max()
Load the dataset CO2 and
  1. Write a R code that write the data.frame CO2, with coma as separator in a file called mondataset.txt.
  2. Load the dataset mondataset.txt in the variable mydata with the names of lines and columns adequately formated (similar to the original CO2).
  3. Write a R code that counts the number of plants that comes from Quebec and have an uptake in $CO_2$ above 35 ( $\frac{\mu mol}{m^2.sec}$), and that have not been chilled in the previous night.
  4. Write a R code that returns the plant (the index in the data.frame CO2) that has the best uptake when the concentration in $CO_2$ in the atmosphere is the lowest.
  5. Write a R code that returns a vector with the maximal uptake of each type of plant of the data.frame CO2 (use an implicit loop).

Advanced graphics

  1. Draw a barplot with the minima and maxima of uptakes of each plant type, use appropriate colors and titles in your graphics.
  2. Draw a heatmap matrix of $uptake, where lines (of the matrix) are the different concentrations ($conc) and columns (of that matrix) are the different plants ($Plant).
  3. Draw a combined graphics with on the left the scatter plot made earlier (cf EX1.2) and the barplot (use par(mfrow=)).