Answer the following questions and complete the exercises in
RMarkdown. Please embed all of your code and push your final work to
your repository. Your final lab report should be organized, clean, and
run free from errors. Remember, you must remove the # for
the included code chunks to run. Be sure to add your name to the author
header above.
Make sure to use the formatting conventions of RMarkdown to make your report neat and clean!
In the data folder, you will find data about shark
incidents in California between 1950-2022. The data
are from: State of California- Shark Incident Database.
library("tidyverse")
library("janitor")
Run the following code chunk to import the data. In this chunk, I am removing NA’s.
sharks <-
read_csv("data/SharkIncidents_1950_2022_220302.csv",
na=c("NA", "N/A", "Unknown", "NOT COUNTED", "", " ")) %>%
clean_names()
Are there any “hotspots” for shark incidents in California? Show the top five counties with the most incidents.
Make a plot that shows the total number of incidents per county.
Are there months of the year when incidents are more likely to occur? Make a plot that shows the total number of incidents by month. Which month has the highest number of incidents?
Is there a time of day when most attacks occur? Make a plot that shows the total number of incidents by time of day. Which time of day has the highest number of incidents?
How do the number and types of injuries compare by county? Make a table that shows the number of injury types by county. Which county has the highest number incidents? (hint: your table should be in wide format)
Use the table from #5 to make a plot that shows the total number of incidents by county.
In the data, mode refers to a type of activity.
Which activity is associated with the highest number of
incidents?
Make a plot that compares the number of incidents by activity.
Which shark species is involved in the highest number of incidents?
Are all incidents involving Great White’s fatal? Make a plot that shows the number and types of incidents for Great White’s only.
Please knit your work as an .html file and upload to Canvas. Homework is due before the start of the next lab. No late work is accepted. Make sure to use the formatting conventions of RMarkdown to make your report neat and clean!