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:” such that it appears “Plotting Basics: Lastname”

2. Import libraries including: FSA, FSAdata, magrittr,  dplyr, plotrix, ggplot2, and moments
NOTE:  You must use R version 3.6.3 to gain access to the FSA data set.  If you installed a later version of R, you must uninstall Rstudio and R. Then reinstall R version 3.6.3; then reinstall Rstudio.

3. Load the BullTroutRML2 dataset (BullTroutRML2)
NOTE: The dataset is already imported into your project when you added the FSA and FSAdata libraries.

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

5. Remove all records except those from Harrison Lake (hint: use the <filterD() function)
NOTE: From this point forward any reference to BullTroutRML2 always refers to the filtered dataset (Harrison Lake only data is used). You may choose to rename the dataset at this point.

6. Display the first and last 5 records from the filtered BullTroutRML2 dataset

7. Display the structure of the filtered BullTroutRML2dataset

8. Display the summary of the filtered BullTroutRML2dataset

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

· Limit of x axis is (0,500)

· Limit of y axis is (0,15)

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

· Y axis label is “Age (yrs)”

· X 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”

X and Y axis limits is 0, 15

· 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,

· Title the plot “Plot 3: Harrison Density Shaded by Era”

· Y axis label is “Age (yrs)”

· Y axis limits are 0 to 15

· X axis label is “Fork Length (mm)”

·  X axis limits are 0 to 500

· include two levels of shading for the “green” data points.

· Plot solid circles as data points

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

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

14. Create a pchs vector with the argument values for + and x.

15. Create a cols vector with the two elements “red” and “gray60”

16. Convert the tmp era values to numeric values.

17. Initialize the cols and pch vectors with the BullTroutRML2 era values

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

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

· Limit of x axis is (0,500)

· Limit of y axis is (0,15)

· Y X axis label is “Age (yrs)”

· X Y axis label is “Fork Length (mm)”

· Set pch equal to pchs era values

· Set col equal to cols era values

19. Plot a regression line overlay on Plot 4 and title the new graph “Plot 5: Regression Overlay”.

20. Place a legend of on Plot 5 and call the new graph “Plot 6: :Legend Overlay”