Objectives

  • Read data from a csv file.
  • Practice basic R plotting

Instructions

Review the information in the walkthrough of reading data with the here() function. You can find it in the Tips Tricks and Walkthroughs section of the course main page.

To complete this activity you need to:

  1. Self-select your group in Moodle.
  2. Download the data files.
  3. Use here() and read.csv() to read the files into data frames.
  4. Create scatterplots and histograms of the data.
  5. Create and upload the report (see below for requirements)

Data

You need the following data files:

  • catrate.csv
  • delomys.csv
  • rope.csv

You can find links on the Assignment Data Files tab of the Course Materials section of the main course page.

Each group member needs to download all three files and save them in the data sub folder of your main Environmental Data course folder (the folder that contains your .RProj file).

Use here() and read.csv() to read the three files into data.frame objects called:

  • dat_catrate
  • dat_delomys
  • dat_rope

Use head() to view the first few lines of each data frame.

Check how many columns contain numeric data in each of the 3 data frames.

You can plot histograms for any column that contains numeric data. For data sets with 2 or more numeric columns you can create scatterplots.

If you want to be fancy, you could even create a conditional boxplot for one of the datasets that contains both a numeric and a factor column.

Report

Submit a document with:

  1. The R-code you used to read each of the three data files. Do not use file.choose()!
  2. A plot (of any type) from each group member.
    • You must add a custom title containing your name to your plot (using the main = argument).
  3. One question or difficulty that your group encountered.

One group member will upload a pdf or html file of the report to Moodle.

Rubric

Your report will be evaluated based on:

  1. (1 pt) The R-code uses here and read.csv.
    • You cannot use file.choose()
  2. (3 pt) There is a plot from each group member
  3. (1 pt) Plots have custom titles with each group member’s name.
  4. (1 pt) Your group submits a question or description of a difficulty with the assignment.