Skip to content

R Intro V: Plotting

Bioinformatics Core Facility Gothenburg edited this page Sep 4, 2017 · 2 revisions
  • Now let’s use the plot() function to take a closer look at the original Orange data.
    • Start with plotting circumference on the x-axis vs age on the y-axis.
    • The plot function has a parameter called col that sets the colors of the points. It needs one single color, or a vector as long as the plotted vectors. Colors can be defined both by text strings and by numbers. Make all points blue by adding col="blue" to the function call. Remember that different arguments need to be separated by commas.
    • Plot the different trees in different colors by adding the Tree column from the Orange data frame as a col argument (instead of "blue").
  • Use the hist() function to make histograms of the circumference and age (one at a time) from the data frame.

Clone this wiki locally