logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Eva EdwardsMathematics
(5/5)

596 Answers

Hire Me
expert
Andrei KrushenkoMarketing
(5/5)

522 Answers

Hire Me
expert
Stevan DuignannNursing
(5/5)

534 Answers

Hire Me
expert
Chase CruzEducation
(5/5)

614 Answers

Hire Me
R Programming
(5/5)

Write a function MeanMonth() that takes Raw as its input, and computes and returns the means of all the individual months as a vector.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

1.      [5 marks] Take your version of Assignment #4 – lynxes and hares and modify it so it stores all the variables from a simulation run in a matrix or data frame. At the end of the simulation run, produce a graph showing all the values of the numbers of lynxes, hares, baby lynxes and hares, dead lynxes and hares and eaten hares for each year of the simulation run. Make the graph as handsome as possible. Hand in the graph for the run of 20 years, 30 initial lynxes and 200 initial hares. If you don’t like your version of Assignment #4, you may modify the solutions and hand that in for full marks. If you use your version and if Mitchell told you there are faults, correct the faults before handing this assignment in. 

2.      [25 marks] Go back to either my solution of Assignment 3 or yours. Basically, you will rewrite a subset of the assignment solution using functions.

a.       Write a function MeanMonth() that takes Raw as its input, and computes and returns the means of all the individual months as a vector. You may use mean(x, na.rm=T) here.

b.      Write a function MonthlyMeanPlot() that takes the above vector as its input to output a plot of the mean monthly temperatures. The x-axis will consist of the 12 months, labelled either by 1 thru 12 or as character strings if you can figure out how to do this. Hint: you can’t assign a plot() as a variable, but a function will return your plot if the plot code is the last code of the function instructions.

c.       Write a function HotMonths() that takes Raw as its input, and computes and returns the total number of months in the data where the mean monthly temperature is greater than or equal to 20 oC and the mean temperature of these hot months. Two values must be returned here, bundled together using whatever data structure you like.

d.      Write a function Extend() that takes Raw as its input, and adds a 14th column consisting of the annual January-December average, creating a new data frame called completed. Extend() then returns completed.

e.       Write a function AnnualPlot() that takes completed as its input and outputs a plot of the annually averaged temperatures. The x-axis will consist of the years 1877-2017.

f.       Hand in all your functions, a run of your code, calling all of your functions, and the two plots. Hints: much of the code in Assignment 3 can be recycled here. You just have to figure out how to write functions and practice passing data among them.

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme