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!
library(tidyverse)
library(janitor)
library(naniar)
For this homework, we will use amniota data from:
Myhrvold N, Baldridge E, Chan B, Sivam D, Freeman DL, Ernest SKM (2015).
“An amniote life-history database to perform comparative analyses with
birds, mammals, and reptiles.” Ecology, 96, 3109. doi:
10.1890/15-0846.1 (URL: https://doi.org/10.1890/15-0846.1).
amniota <- read_csv("data/amniota.csv") %>%
clean_names()
Do some exploratory analysis of the amniota data
set. Use the function(s) of your choice. Try to get an idea of how NA’s
are represented in the data.
Make any necessary replacements in the data such that all NA’s appear as “NA”.
How many total NA’s are in the data set? Use the package
naniar to produce a summary, including percentages, of
missing data in each column for the amniota data.
Double check your replacement using summary. Do you
see any other potential issues? If so, fix them.
Use naniar to visualize the number of NA’s in each
variable. Which variables have the most NA’s?
Calculate the number of NAs in the egg_mass_g column
sorted by taxonomic class; i.e. how many NA’s are present in the
egg_mass_g column in birds, mammals, and reptiles? Does
this results make sense biologically? How do these results affect your
interpretation of NA’s?
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!