User Tools

Site Tools


Translations of this page:

Back to BIS-Schools

Biodiversity data analysis with R






W09-1 Plotting nicely

This worksheet revisits the plotting functions for a closer look on layout and labeling. After completing this worksheet you should know how to make plots which are fine for presentations.

Things you need for this worksheet

  • R — the interpreter can be installed on any operation system. For Linux, you should use the r-cran packages supplied for your Linux distribution. If you use Ubuntu, this is one of many starting points. If you use windows, you could install R from the official CRAN web page.

  • R Studio — we recommend to use R Studio for (interactive) programming with R. You can download R Studio from the official web page.

  • your script and data from W06-1 Leave-one-out validation

Learning log assignments

:!: The following script is build on top of your script from W06-1. Please copy your script “W06-1.R”, rename the copy to “W09-1.R” and use it for the programming tasks of this worksheet.

Enough of theory…it's all about looks now!!! 8-)

:-\ Please make a scatter plot which shows the predicted vs. observed animal activity values. As you can easily see, there is much space for improvement.

:-\ First of all we want to change those nasty axis names. Let's do the scatter plot again and use the arguments “xlab” and “ylab” within the function plot() to get user defined axis titles.

:-\ Of course a title would be nice, too. The argument for that within the function plot() is “main”.

:-\ Now…let's be creative. Get some inspiration on and then come back to change the color of your symbols.

:-\ You can also add a legend using the function legend().

:-\ Finally, add a diagonal line, where the observed equals the predicted value.

en/learning/schools/s01/worksheets/ba-ws-09-1.txt · Last modified: 2015/09/22 16:22 (external edit)