Answered step by step
Verified Expert Solution
Question
1 Approved Answer
# Question 2 (Total marks: 11) one of R's built-in datasets is ChickWeight . Take some time to bring up and inspect the corresponding help
# Question 2 (Total marks: 11) one of R's built-in datasets is ChickWeight . Take some time to bring up and inspect the corresponding help file (obtained by typing ?ChickWeight at the prompt) to familiarise yourself with the nature of the data it contains.### (c) [2 marks] Using a subset of CW that contains just those measurements taken on the 21st day, use an appropriate command from the apply family to find the mean weight split by feed type. Vary this slightly to also find the standard deviation of the weights by feed type. Answer:_ - -YOUR ANSWER HERE-- ### (d) [4 marks] Using base R graphics, provide a $2\\times 2$ arrangement of four plots, each of which corresponds to one of the four feed types. For a given feed type, the corresponding plot should be a set of overlapping lines showing the weight (on the $y$-axis) against the time (on the $x$-axis) for each individual chick in that feed group. Each plot should have the same $y$-axis limits. For full marks you must use a nested for loop to place each of these plots in the $2\\times 2$ arrangement, and each plot must clearly identify in a title the feed group to which it pertains. You don't need to label or use different colours to distinguish between the different lines within each of the plots. Use your CW data frame, not ChickWeights . HINT 1: Your outer loop should cycle through the feed type 1:4 , and your inner loop should cycle through the unique chick IDs within each feed group so that each line can be plotted. HINT 2: You can start a new 'empty' plot by setting type="n" . Answer :_ --YOUR ANSWER HERE
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started