ggplot(badgers_clean) +geom_bar(aes(x = BADGER_STATUS, fill = BADGER_ACTION)) +theme_bw() +labs(x ="Badger status", fill ="Action", title ="Total badgers captured")
Number of recaptures per year
Code
recap_count <- badgers_clean %>%group_by(BADGER_ID) %>%summarise(n_captures =n(), SETT_ID =head(SETT_ID, 1)) %>%ungroup()ggplot(recap_count) +geom_bar(aes(x = n_captures)) +scale_x_continuous(breaks =1:10, labels =1:10) +theme_bw() +labs(x ="Number of recaptures", title ="How many times have animals been recaptured?")
Yearly captures and recaptures
Code
ggplot(badgers_clean) +geom_bar(aes(x = YEAR, fill = BADGER_STATUS)) +scale_x_continuous(breaks =2018:2023, labels =2018:2023) +theme_bw() +labs(fill ="Badger status", title ="Badgers captured yearly")
Merge with sett data so we can have spatial information and plot
The badger dataset on its own does not have information on where the badger was captured, but it does have information on what sett they were captured in (or nearby). Therefore, we can combine the information on the sett dataset and obtain coordinates for each badger (that will be sett coordinates)
Overall
Code
badgers_clean_sf <- badgers_clean %>%left_join(sett_all) %>%st_set_geometry("geometry")ggplot(badgers_clean_sf) +geom_sf(data = counties) +geom_sf(aes(col =factor(YEAR))) +geom_sf(data = ded2, col ="red", fill =NA) +scale_colour_viridis_d() +labs(col ="Year") +theme_bw() +labs(col ="Capture year", title ="Badgers captured overall")
Yearly
Code
ggplot(badgers_clean_sf %>%filter(!is.na(YEAR))) +geom_sf(data = counties) +geom_sf(aes(col = BADGER_STATUS)) +geom_sf(data = ded2, fill =NA, col ="red") +scale_colour_viridis_d() +facet_wrap(~YEAR) +theme_bw() +theme(legend.position="top") +labs(col ="Badger status", title ="Badgers captured yearly")
Effort
The effort data comes from a dataset obtained from DAFM detailing the capture events conducted in each quartile, and the date each commenced and finished, which allows us to know how many days each capture event lasted.
With this dataset we can know how many days of effort were conducted in each quartile. Therefore, the smallest unit of effort (spatially) that we can obtain from this dataset is the quartile.