Predator summary

Counts

The six most abundant species (in ind km^-1).

Code
top_six <- predators_agg %>% 
  group_by(species) %>% 
  summarize(total_count = sum(count)) %>% 
  arrange(desc(total_count)) %>%
  slice(1:6) %>% 
  mutate(common_name = c("Snow petrel", 
                         "Antarctic fur seal",
                         "Adélie penguin",
                         "Crabeater seal",
                         "Antarctic petrel",
                         "Southern fulmar"))

top_six
# A tibble: 6 × 3
  species total_count common_name       
  <chr>         <dbl> <chr>             
1 SNPT          17347 Snow petrel       
2 FUSE           9665 Antarctic fur seal
3 ADPN           9578 Adélie penguin    
4 CRSE           3858 Crabeater seal    
5 ANPT           3367 Antarctic petrel  
6 ANFU           1476 Southern fulmar   
Code
top_six_plot_data <- predators_agg %>% 
  semi_join(top_six, by = "species") %>% 
  group_by(year, species) %>% 
  summarize(total = sum(count), .groups = "drop") %>% 
  mutate(species = fct_reorder(species, total, .fun = sum),
         year = factor(year, levels = 2016:2012))
year_labels <- top_six_plot_data %>% 
  filter(species == "SNPT") %>% 
  arrange(desc(year)) %>%                   # Make the labels show up at
  mutate(total = cumsum(total) - total / 2) # correct y-axis position

ggplot(top_six_plot_data, aes(species, total, group = year)) +
  geom_col(color = "black", fill = "grey80") +
  geom_text(aes(label = year), year_labels) +
  labs(y = "Total species count") +
  theme_classic() +
  theme(axis.title.x = element_blank())

Maps

Survey effort. 21 out of the 19404 intervals were recorded as nmi > 1000 (as opposed to ~1 nmi for the rest). Those intervals excluded from the survey effort.

Climatologies

Code
# Make "top six" predator sightings spatially aware
topsix_sf <- predators_agg %>% 
  semi_join(top_six, by = "species") %>% 
  left_join(select(top_six, species, common_name), by = "species") %>% 
  latlon_to_sf(coords = c("lon_mean", "lat_mean"))
# Create a template raster of the study area
effort_ext <- effort_sf %>% 
  st_transform(ant_proj()) %>% 
  ext()
rast_template <- rast(crs = as.character(ant_proj())[[1]],
                      extent = effort_ext,
                      resolution = 30e3)
# Rasterize effort by year
effort_rast <- effort_sf %>% 
  st_transform(ant_proj()) %>% 
  rasterize_by("km", "year", sum, rast_template)

# Rasterize the predator sightings by year and species
topsix_rast <- topsix_sf %>% 
  st_transform(ant_proj()) %>% 
  mutate(year_commonname = as.character(interaction(year, common_name))) %>% 
  rasterize_by("count", "year_commonname", sum, rast_template)

# Normalize counts by effort
topsix_norm <- topsix_rast
for (i in seq(nlyr(topsix_rast))) {
  lyr_name <- names(topsix_rast)[i]
  lyr_year <- substr(lyr_name, 1, 4)
  effort_year <- effort_rast[lyr_year] %>% 
    subst(0, NA)
  topsix_norm[[i]] <- topsix_norm[[i]] / effort_year
}
# Average across years
topsix_climatology <- unique(top_six$common_name) %>% 
  map(function(sp) {
    sp_rast <- subset(topsix_norm, 
                      which(str_detect(names(topsix_norm), sp)))
    mean(sp_rast, na.rm = TRUE)
  }) %>% 
  set_names(unique(top_six$common_name)) %>% 
  rast()
# Classify raster (otherwise CRSE throw it all off)
topsix_clim_class <- topsix_climatology %>% 
  classify(rcl = c(0, 1, 5, 10, 50))

# Project bounding box
map_bbox <- ext(-63, -54, -64, -59) %>% 
  project(from = "+proj=longlat +datum=WGS84",
          to = as.character(ant_proj())[[1]])
 
# Make the map! 
ant_basemap() +
  geom_spatraster(data = topsix_clim_class) +
  geom_sf(data = ant_sf) +
  scale_fill_brewer(palette = "RdPu", 
                    na.value = NA, 
                    direction = 1,
                    na.translate = FALSE) +
  scale_x_continuous(breaks = seq(-64, -54, by = 4)) +
  scale_y_continuous(breaks = seq(-64, -59, by = 2)) +
  labs(fill = expression("Ind km"^-1)) +
  facet_wrap(~lyr) +
  coord_sf(xlim = map_bbox[1:2],
           ylim = map_bbox[3:4],
           crs = ant_proj()) +
  theme(legend.position = "top")

Survey effort

Code
map_bbox <- ext(effort_rast)

ant_basemap() +
  geom_spatraster(data = effort_rast) +
  scale_fill_distiller(palette = "PuRd", 
                       direction = 1, 
                       na.value = NA) +
  scale_x_continuous(breaks = seq(-64, -54, by = 4)) +
  scale_y_continuous(breaks = seq(-64, -57, by = 2)) +
  coord_sf(xlim = map_bbox[1:2],
           ylim = map_bbox[3:4],
           crs = ant_proj()) +
  labs(fill = "km") +
  facet_wrap(~lyr) +
  expand_limits(fill = 0)

Yearly distributions

Distribution maps of the six most abundant species in each survey year, aggregated to 30km bins.

Code
map_bbox <- ext(-63, -54, -64, -59) %>% 
  project(from = "+proj=longlat +datum=WGS84",
          to = as.character(ant_proj())[[1]])

topsix_class <- topsix_rast %>% 
  classify(rcl = c(0, 1, 5, 10, 50, 100, 1000, Inf))

topsix_class_df <- topsix_class %>% 
  as.data.frame(xy = TRUE) %>% 
  pivot_longer(-c("x", "y"), 
               names_to = "name", 
               values_to = "count") %>% 
  separate_wider_delim(name, 
                       delim = ".", 
                       names = c("year", "species")) %>% 
  drop_na(count)

ant_basemap() +
  geom_raster(aes(x, y, fill = count), topsix_class_df) +
  geom_sf(data = tar_read("ant_sf", store = here::here("_targets"))) +
  scale_fill_brewer(palette = "RdPu", 
                    na.value = NA, 
                    direction = 1,
                    na.translate = FALSE) +
  scale_x_continuous(breaks = seq(-64, -54, by = 4)) +
  scale_y_continuous(breaks = seq(-64, -59, by = 2)) +
  labs(fill = expression("Ind km"^-1)) +
  facet_grid(species ~ year) +
  coord_sf(xlim = map_bbox[1:2],
           ylim = map_bbox[3:4],
           crs = ant_proj()) +
  theme(legend.position = "right",
        text = element_text(size = 8))

Distribution maps of six species of interest in each survey year, also aggregated to 25km bins.

Code
soi <- c("GEPN", "BLPT", "ANTE", "LESE", "KIWH")

soi_sf <- predators_agg %>% 
  filter(species %in% soi) %>% 
  latlon_to_sf(coords = c("lon_mean", "lat_mean"))

soi_rast <- soi_sf %>% 
  st_transform(ant_proj()) %>% 
  mutate(year_species = as.character(interaction(year, species))) %>% 
  rasterize_by("count", "year_species", sum, rast_template)

map_bbox <- ext(-63, -54, -64, -59) %>% 
  project(from = "+proj=longlat +datum=WGS84",
          to = as.character(ant_proj())[[1]])

soi_class <- soi_rast %>% 
  classify(rcl = c(0, 1, 5, 10, 50, 100, 1000))

soi_class_df <- soi_class %>% 
  as.data.frame(xy = TRUE) %>% 
  pivot_longer(-c("x", "y"), 
               names_to = "name", 
               values_to = "count") %>% 
  separate_wider_delim(name, 
                       delim = ".", 
                       names = c("year", "species")) %>% 
  drop_na(count)

ant_basemap() +
  geom_raster(aes(x, y, fill = count), soi_class_df) +
  geom_sf(data = tar_read("ant_sf", store = here::here("_targets"))) +
  scale_fill_brewer(palette = "RdPu", 
                    na.value = NA, 
                    direction = 1,
                    na.translate = FALSE) +
  scale_x_continuous(breaks = seq(-64, -54, by = 4)) +
  scale_y_continuous(breaks = seq(-64, -59, by = 2)) +
  labs(fill = expression("Ind km"^-1)) +
  facet_grid(species ~ year) +
  coord_sf(xlim = map_bbox[1:2],
           ylim = map_bbox[3:4],
           crs = ant_proj()) +
  theme(legend.position = "right",
        text = element_text(size = 8))

Distribution maps of all species in all years, for supplemental. Organized by mammals and birds

Code
pred_sf <- predators_agg %>% 
  filter(!str_starts(species, "U")) %>% 
  mutate(common_name = code_to_common(species)) %>% 
  latlon_to_sf(coords = c("lon_mean", "lat_mean"))

pred_rast <- pred_sf %>% 
  st_transform(ant_proj()) %>% 
  mutate(year_commonname = as.character(interaction(year, common_name))) %>% 
  rasterize_by("count", "year_commonname", sum, rast_template)

# Normalize counts by effort
pred_norm <- pred_rast
for (i in seq(nlyr(pred_rast))) {
  lyr_name <- names(pred_rast)[i]
  lyr_year <- substr(lyr_name, 1, 4)
  effort_year <- effort_rast[lyr_year] %>% 
    subst(0, NA)
  pred_norm[[i]] <- pred_norm[[i]] / effort_year
}
# Average across years
pred_climatology <- unique(code_to_common(pred_sf$species)) %>% 
  map(function(sp) {
    sp_rast <- subset(pred_norm, 
                      which(str_detect(names(pred_norm), sp)))
    mean(sp_rast, na.rm = TRUE)
  }) %>% 
  set_names(unique(pred_sf$common_name)) %>% 
  rast()

map_bbox <- ext(-63, -54, -64, -59) %>% 
  project(from = "+proj=longlat +datum=WGS84",
          to = as.character(ant_proj())[[1]])

pred_class <- pred_climatology %>% 
  classify(rcl = c(0, 1, 5, 10, 50, 100, 1000))

pred_class_df <- as.data.frame(pred_class, xy = TRUE) %>% 
  pivot_longer(-c("x", "y"), 
               names_to = "name", 
               values_to = "count") %>% 
  drop_na(count) %>% 
  mutate(name = map_chr(name, \(n) paste(strwrap(n, 20), collapse = "\n"))) %>% 
  # one sighting each, maps not useful
  filter(!name %in% c("Antarctic prion", "Humpback whale"))
Code
bird_class_df <- pred_class_df %>% 
  semi_join(tibble(name = c(
    "Blue petrel",
    "Antarctic shag",
    "Cape petrel",
    "Kelp gull",
    "Antarctic petrel",
    "Southern giant\npetrel",
    "Adélie penguin",
    "Kerguelen petrel",
    "Gentoo penguin",
    "Antarctic tern",
    "Northern giant\npetrel",
    "Pale-faced\nsheathbill",
    "Chinstrap penguin",
    "Southern fulmar",
    "Antarctic prion",
    "Common diving\npetrel",
    "South polar skua",
    "Snow petrel",
    "Emperor penguin",
    "Black-browed\nalbatross"
  )), by = "name")

p <- ant_basemap() +
  geom_raster(aes(x, y, fill = count), bird_class_df) +
  geom_sf(data = ant_sf) +
  scale_fill_brewer(palette = "RdPu", 
                    na.value = NA, 
                    direction = 1,
                    na.translate = FALSE) +
  scale_x_continuous(breaks = seq(-64, -54, by = 4)) +
  scale_y_continuous(breaks = seq(-64, -59, by = 2)) +
  labs(fill = expression("Ind km"^-1)) +
  facet_wrap(~ name, ncol = 5) +
  coord_sf(xlim = map_bbox[1:2],
           ylim = map_bbox[3:4],
           crs = ant_proj()) +
  theme(legend.position = "top",
        text = element_text(size = 8))

ggsave(here::here("figs/s1.jpg"), 
       p, 
       width = 6.5, 
       height = 9, 
       units = "in", 
       dpi = 600)

p

Code
mammal_class_df <- pred_class_df %>% 
  anti_join(bird_class_df, by = "name")

p <- ant_basemap() +
  geom_raster(aes(x, y, fill = count), mammal_class_df) +
  geom_sf(data = ant_sf) +
  scale_fill_brewer(palette = "RdPu", 
                    na.value = NA, 
                    direction = 1,
                    na.translate = FALSE) +
  scale_x_continuous(breaks = seq(-64, -54, by = 4)) +
  scale_y_continuous(breaks = seq(-64, -59, by = 2)) +
  labs(fill = expression("Ind km"^-1)) +
  facet_wrap(~ name, ncol = 3) +
  coord_sf(xlim = map_bbox[1:2],
           ylim = map_bbox[3:4],
           crs = ant_proj()) +
  theme(legend.position = "top",
        text = element_text(size = 8))

ggsave(here::here("figs/s2.jpg"), 
       p, 
       width = 6.5, 
       height = 9, 
       units = "in", 
       dpi = 600)

p