Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit



ALY6000: Executive Summary Report 2

Dataset Instructions

 

Complete the following instructions to create the dataset and output required for the            Executive Summary Report in Module 2. The output you create from the following steps      must be incorporated into your report. Be sure to save your R script file with the following naming convention:

LastName_M2_Project2

Append your completed R-Script to the Executive Summary

Instructions

To complete this assignment you must create an R script file that includes the code required to complete the following steps:

1.   Print your name at the top of the script. Include the prefix: “Plotting Basics:”

2.   Import libraries including: plyr, FSA, FSAdata, magrittr,  dplyr, plotrix, ggplot2, and moments

3.   Load the BullTroutRML2 dataset

4.   Print the first and last 3 records from the dataset

5.   Filter out all records except those from Harrison Lake

6.   Display the first and last 3 records from the filtered dataset

7.   Display the structure of the filtered dataset

8.   Display the summary of the filtered dataset and save it as <t>

9.   Create a scatterplot for “age” (y variable) and “fl” (x variable) with the following specifications:

•    Limit ofx axis is (0,500)

•    Limit of y axis is (0,15)

•    Title of graph is “Plot 1: Harrison Lake Trout

•    X axis label is “Age (yrs)”

•    Y axis label is “Fork Length (mm)”

•    Use a small filled circle for the plotted data points

10. Plot an “Age” histogram with the following specifications

•    Y axis label is “Frequency”

•    X axis label is “Age (yrs)”

•    Title of the histogram is “Plot 2: Harrison Fish Age Distribution”

•    The color of the frequency plots is “cadetblue”

•    The color of the Title is “cadetblue”

11. Create an overdense plot using the same specifications as the previous scatterplot. But, include two levels of shading for the “black” data points. Title the plot “Plot 3: Harrison Density Shaded by Era”

12. Create a new object called “tmp” that includes the first 3 and last 3 records ofthe whole data set.

13. Display the “era” column in the new “tmp” object

14. Create a pchs vector with the argument values for + and x. Then create a cols vector with the two elements “red” and “gray60”

15. Convert the tmp object values to numeric values. Then create a numeric numEra object from the tmp$era object

16. Associate the cols vector with the tmp era values

17. Create a plot of “Age (yrs)” (y variable) versus “Fork Length (mm)” (x variable) with the following specifications:

•    Limit ofx axis is (0,500)

•    Limit of y axis is (0,15)

•    Title of graph is “Plot 4: Symbol & Color by Era”

•    X axis label is “Age (yrs)”

•    Y axis label is “Fork Length (mm)”

•    Set pch equal to pchs era values

•    Set col equal to cols era values

18. Plot a regression line of the previous plot with a dashed line with width 2 and color “cadetblue”

19. Place a legend of levels by era with pchs symbols in the top left of the plot with the following specifications:

•    Inset of 0.05

•    No box around the legend

•    Font size: 75% of nominal