[1] 17055.37
Functions combining functions (solution)
NoteExercise
Write two functions:
- One called
get_mass_from_length()that takeslength(in m),aandbas arguments, has the following default argumentsa = 39.9andb = 2.6, uses the following code to estimate the mass (in kg)mass <- a * length ^ b, and returns it. (This function is the answer to the Default Arguments exercise, so feel free to copy over your answer if you’ve done that exercise). - One called
convert_kg_to_poundsthat converts kilograms into pounds (pounds = 2.205 * kg)
Use these two functions (each function should be called separately) to estimate the weight, in pounds, of a 12 m long Stegosaurus with
a = 10.95andb = 2.64(The estimatedaandbvalues for Stegosauria from Seebacher 2001).Use these two functions (each function should be called separately) to estimate the weight, in pounds, of a 4 m long dinosaur using the default parameters.
CautionOutput solution
[1] 3233.981