Skip to content

Commit

Permalink
Merge pull request #57 from brymz/Graphing-3
Browse files Browse the repository at this point in the history
Graphing 3
  • Loading branch information
ethanwhite committed Jun 15, 2015
2 parents f393708 + c4c5b0d commit 5cf49ce
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions exercises/Graphing-3-R.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
layout: exercise
title: Graphing 3
language: R
---

It makes sense that larger organisms have larger offspring, but what the
mathematical form of this relationship should be is unclear. Let's
look at the problem empirically for mammals.

Download some
[mammal life history data](http://esapubs.org/archive/ecol/E084/093/Mammal_lifehistories_v2.txt) from the web.
You can do this either directly in the program using `read.csv()` or download
the file to your computer using your browser and import it from there.

When you import the data there are some extra blank lines at
the end of this file. Get rid of them by using the optional `read.csv()`
argument to select the valid 1440 rows, `nrows = 1440`.

Missing data in this file is specified by -999 and -999.00. Tell R that
these are null values using the optional `read.csv()` argument,
`na.strings = c("-999", "-999.00")`. This will stop them from being plotted.

1. Graph adult mass vs. newborn mass. Label the axes.
2. Graph the log (base 10) of adult mass vs. the log (base 10) of
newborn mass. Label the axes.
3. For data where `order` is `"Rodentia"`, graph the log (base 10) of adult mass
vs. the log (base 10) of newborn mass. Label the axes.

0 comments on commit 5cf49ce

Please sign in to comment.