If dinosaur_lengths.csv
is not already in your working directory download a copy of the data on dinosaur lengths with species names. Load it into R.
Write a function mass_from_length()
that uses the equation mass <- a * length^b
to estimate the size of a dinosaur from its length.
This function should take two arguments, length
and species
. For each of the following inputs for species
, use the given values of a
and b
for the calculation from Seebacher 2001:
Stegosauria
: a = 10.95
and b = 2.64
Theropoda
: a = 0.73
and b = 3.63
Sauropoda
: a
= 214.44
and b = 1.46
species
: a = 25.37
and b = 2.49
head()
.head()
.species
using dplyr
.