For these exercise download and import the data files containing my Ebird observations from here: https://github.com/mbtoomey/Biol_7263/blob/main/Data/MBT_ebird.csv?raw=true

#load packages library(dplyr) library(tidyverse) MBT_ebird<-read_csv(“https://github.com/mbtoomey/Biol_7263/blob/main/Data/MBT_ebird.csv?raw=true”) head(MBT_ebird)

#In which year did I observe the most individual birds? How many?

MBT_ebird <- group_by(MBT_ebird, year) ungroup(MBT_ebird)

#this pulled just a column of the years MBT_years <- select(MBT_ebird, matches(“year”))

#this pulled the coulmns i wanted but did not consolidate the years like i wanted it too MBT_years2 <- select(MBT_ebird, common_name, count, year)

#this returned a tibble with the year and total amount of birds seen for that year each in their own column summarize(MBT_ebird, birdtotal=max(count_tot, na.rm=TRUE)) # in 2020 the most individual birds were observed at 3154. # A tibble: 13 × 2 year birdtotal 1 2003 18 2 2004 228 3 2009 25 4 2013 106 5 2014 469 6 2015 253 7 2016 87 8 2017 515 9 2018 275 10 2019 88 11 2020 3154 12 2021 696 13 2022 582

#In that year how many different species of birds did I observe?

#filter for just the 2020 data MBT_ebird2020 <- filter(MBT_ebird, year == 2020)

MBT_ebird2020 <- group_by(MBT_ebird2020, scientific_name) #this give us the amount of species record for 2020 (146) and the following value is a 1 indicating the year 2020

[1] 146 1

#In which state did I most frequently observe Red-winged Blackbirds?

dim(summarize(MBT_ebird2020))

MBT_ebird <- group_by(MBT_ebird, location, common_name, count) dim(summarize(MBT_ebird)) ungroup(MBT_ebird)

#this put out a tibble with coulmns grouped by location, common name, count, and rwbb summarize(MBT_ebird, rwbb=max(count_tot, na.rm=TRUE))

#this pulled out only the entries for RWBB MBT_ebirdRWBB <- filter(MBT_ebird, common_name == “Red-winged Blackbird”)

MBT_ebirdRWBB <- group_by(MBT_ebirdRWBB, location) # this takes the data that has been summarized by location and condeses the count_tot of each bird observed in a state and condenses it summarize(MBT_ebirdRWBB, RWBB_sum=sum(count_tot)) #The state with the most observations of RWBB is Missouri # A tibble: 5 × 2 location RWBB_sum 1 US-FL 168 2 US-IL 30 3 US-MO 8443 4 US-OK 6861 5 US-VT 391

#Filter observations for a duration between 5 and 200 minutes. Calculate the mean rate per checklist that I encounter species each year. Specifically, calculate the number of species in each checklist divided by duration and then take the mean for the year.

MBT_ebird_duration <- filter(MBT_ebird, duration <= “200” | duration >= “5”) MBT_ebird_duration <- filter(MBT_ebird_duration, duration != “0”) MBT_ebird_duration <- filter(MBT_ebird_duration, duration != “2”)

MBT_ebirdmutate <- mutate(MBT_ebird_duration, rate = n_distinct(common_name)/(duration))

MBT_ebirdmean %>% group_by(year) %>% mutate(yrmean = mean(rate)) view(MBT_ebirdmean)

#Create a tibble that includes the complete observations for the top 10 most frequently observed species. First generate a top 10 list and then use this list to filter all observations. Export this tibble as a .csv file saved to a folder called “Results” folder within your R project and add link to the markdown document.

#create a list of 10 MBT_ebird10 <- MBT_ebird %>% count(common_name) %>% arrange(by=(desc(n))) MBT_ebird10 <- as.list(MBT_ebird10$common_name[1:10])

#convert this list to a tibble