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

ALY6000: Executive Summary Report 3

2023 Winter A

Dataset Instructions

Complete the following instructions to create the dataset and output required for the Executive Summary Report in Module 3. Use the R in Action textbook and web searches when needed to write the appropriate R script. The output you create by following these steps must be incorporated into the Appendix of your report. Be sure to save your R script file with the following naming convention:

LastName_M3_Project3

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 and load these libraries: FSA, FSAdata, magrittr, dplyr, tidyr plyr and tidyverse

2.   Import the inchBio.csv and name the table <tBio>

3.   Display the first 3 and last 3 records, summary and structure of <tBio>

4.   Create an object <cts>, that counts and lists all the species records

5.   Display just the 8 levels (names) of the species

6.   Create a <temp1> object that displays the different species and the number of records of each species in the dataset. Include this information in your report.

7.   Create a subset, <temp2>, of just the species variable and display the first 3 records

8.   Create a table, <t>, of the species variable. Display the class of <t>

9.   Convert <t> to a data frame named <df> and display the results

10. Extract and display the frequency values from the <df> data frame as variable freq

11. Create a table named <tSpec> from the <tBio> species attribute (variable) and confirm that you created a table which displays the number of species in the dataset <tBio>

12. Create a table named <tSpecPct> that displays the species and percentage of records for each species. Confirm you created a table class.

13. Convert the table, <tSpecPct>, to a data frame named <dfSP> and confirm that <dfSP> is a data frame

14. Create a barplot of <tSpec> with the following specifications:

•   Title: “ Plot 1: Fish Count”

•   Y axis is labeled Counts”

•   Y axis limits of 0 to 250

•   Color the bars Red

•   Rotate X axis label to be vertical

•   Set the X axis font magnification to 55% of nominal

15. Create a barplot of <tSpecPct>, with the following specifications:

•   Y axis limits of 0 to 0.35

•   Y axis is labeled “%

•   Color the bars Yellow

•   Title:  “Plot 2: Fish Relative Frequency”

•   The rest should be the same as Step 14

16. Rearrange the <dfSP> data frame in descending order of relative frequency. Save the rearranged data frame as the object <data>

17. Rename the <data> columns Var 1 to Species, and Freq to RelFreq

18. Add new variables to <data> and call them cumFreq, cts, and cumCts

•   cum means cumulative

19. Create a parameter variable <varPar> to store graphical parameters

20. Create a barplot for data$cts, <pc>, with the following specifications:

•   width of 1, spacing of .1

•    no boarder

•   Axes: F

•   Y axis limit: 0, 3.05*max(data$cts, na.rm=T)

•   Y label is Cumulative Counts”

•   Set the X axis font magnification to 55% of nominal

•   names.arg: data$Species

•   Title of the barplot is Plot 3: Species Pareto”

•   las: 2

21. Add a cumulative counts line to the <pc> plot with the following:

•   Spec line type is b”

•   Scale plotting text at 75%

•   Data values are marked with symbol of solid triangle and with color Blue”

22. Place a grey(grey62) box around the pareto plot (hint:             https://www.statmethods.net/advgraphs/parameters.html)

23. Add a left side axis with the following specifications

•   Horizontal values at tick marks at cumCts on side 2

•   Axis color of grey62 and label color of grey62

•   Axis font scaled to 75% of nominal

(hint:https://www.statmethods.net/advgraphs/axes.html)

24. Add axis details on right side of box with the specifications:

•   Spec: Side 4

•   Tick marks at cumCts with labels from 0 to cumFreq with %,

•   Axis color of cyan4 and label color of cyan4

•   Axis font scaled to 75% of nominal

25. Display the finished Species Pareto Plot.

•   Have your last name on the plot with red color. (Not part of the title)

•   Scale plotting text at 75%