First Steps:

Getting to know the dataset & making it more useful

sq <- squirrels
skim(sq)
sq$shift %<>% factor()
sq$primary_fur_color %<>% replace_na("Unknown")
sq$primary_fur_color %<>% factor()
sq$location %<>% factor()
sq$age %<>% gsub(pattern = "\\?", replacement = NA) %>% factor()
sq %<>% mutate(hect_coord_ltr = (substr(hectare, 3, 3)))
sq %<>% mutate(hect_coord_num = (substr(hectare, 1, 2)))
sq$hect_coord_ltr %<>% factor(levels = c(LETTERS[1:9]))
sq$hect_coord_num %<>% as.numeric() %>% factor(levels = c(1:42))

sq_sum = tibble(n_s = numeric(), e_w = character(), color = character(), total = numeric())
for(i in 1:42){
  for(j in LETTERS[1:9]){
    for(k in c("Gray", "Cinnamon", "Black")){
      sq_sum %<>% add_row(n_s = i, e_w = j, color = k, total = (sq %>% filter(hect_coord_num == i & hect_coord_ltr == j & primary_fur_color == k) %>% nrow()))
    }
  }
}
sq_sum$n_s %<>% factor()
sq_sum$e_w %<>% factor()
sq_sum$color %<>% factor()

sq_activities = sq %>% select(age, approaches, indifferent, runs_from) %>% filter((approaches == T & indifferent == F & runs_from == F) | (approaches == F & indifferent == T & runs_from == F) | (approaches == F & indifferent == F & runs_from == T))
sq_behavior = tibble(age = character(), action = character(), num = numeric())
sq_behavior %<>% add_row(age = "Adult", action = "approaches", num = (sq_activities %>% filter(age == "Adult", approaches == TRUE) %>% nrow()))
sq_behavior %<>% add_row(age = "Adult", action = "indifferent", num = (sq_activities %>% filter(age == "Adult", indifferent == TRUE) %>% nrow()))
sq_behavior %<>% add_row(age = "Adult", action = "runs_from", num = (sq_activities %>% filter(age == "Adult", runs_from == TRUE) %>% nrow()))
sq_behavior %<>% add_row(age = "Juvenile", action = "approaches", num = (sq_activities %>% filter(age == "Juvenile", approaches == TRUE) %>% nrow()))
sq_behavior %<>% add_row(age = "Juvenile", action = "indifferent", num = (sq_activities %>% filter(age == "Juvenile", indifferent == TRUE) %>% nrow()))
sq_behavior %<>% add_row(age = "Juvenile", action = "runs_from", num = (sq_activities %>% filter(age == "Juvenile", runs_from == TRUE) %>% nrow()))
sq_behavior$age %<>% factor()
sq_behavior$action %<>% factor()

sq_adult_actions = sum((filter(sq_behavior, age == "Adult") %>% select(num)))
sq_juvenile_actions = sum((filter(sq_behavior, age == "Juvenile") %>% select(num)))
sq_juv_percs = (filter(sq_behavior, age == "Juvenile") %>% select(num)) / sq_juvenile_actions
sq_adult_percs = (filter(sq_behavior, age == "Adult") %>% select(num)) / sq_adult_actions
sq_diff = tibble(action = levels(sq_behavior$action), difference = sq_adult_percs - sq_juv_percs)
sq_diff$difference = sq_diff$difference[[1]]
sq_diff = cbind(sq_diff, negative = c(T, F, T))

sq_shift_color = tibble(shift = character(), color = character(), count = numeric())
for(i in c("AM", "PM")){
  for(j in c("Black", "Gray", "Cinnamon")){
    sq_shift_color = add_row(sq_shift_color, shift = i, color = j, count = filter(sq, shift == i, primary_fur_color == j) %>% nrow())
  }
}
sq_shift_color$shift %<>% factor()
sq_shift_color$color %<>% factor()

Drafts:

Q1: Where are different color squirrels seen? Where are they more or less frequent?

ggplot(sq, aes(hect_coord_ltr, hect_coord_num, fill = primary_fur_color))+
  geom_tile()+
  scale_fill_manual(values = c("Black" = "Black", "Cinnamon" = "darkorange3", "Gray" = "Grey", "Unknown" = "maroon1"))+
  coord_fixed(ratio = 1)+
  facet_wrap(sq$primary_fur_color, 1, 4)+
  scale_y_discrete(limits = rev)+
  labs(title = "Where squirrels have been seen, by color", x = "East - West Hectare Coordinate", y = "North - South Hectare Coordinate")+
  theme(legend.position = "none")

ggplot(sq_sum, aes(e_w, n_s, color = color))+
  geom_point(aes(size = total))+
  scale_size_area()+
  scale_color_manual(values = c("Black" = "Black", "Cinnamon" = "darkorange3", "Gray" = "Grey"))+
  coord_fixed(ratio = 1)+
  facet_wrap(sq_sum$color, 3, 14)+
  scale_y_discrete(limits = rev)+
  labs(title = "Where squirrels are seen most frequently, by color", x = "East - West Hectare Coordinate", y = "North - South Hectare Coordinate")+
  guides(color = "none")

Q2: Is there any correlation between squirrels’ ages and their interactions with humans?

ggplot(sq_behavior, aes(forcats::fct_rev(action), num, fill = age))+
  geom_col(position = "dodge")+
  scale_fill_grey(name = "Age")+
  scale_x_discrete(labels = c("Runs from human", "Indifference", "Approaches human"))+
  labs(title = "What behaviors towards humans were shown by adult vs. juvenile squirrels?", x = NULL, y = "Number of interactions in which a behavior was exhibited")

ggplot(sq_diff, aes(forcats::fct_rev(action), difference, fill = negative))+
  geom_col()+
  scale_fill_manual(values = c("Black", "firebrick1"), labels = c("More frequent among adults", "More frequent among juveniles"))+
  scale_y_continuous(limits = c(-0.25, 0.25), breaks = c(-0.3, -0.2, -0.1, 0, 0.1, 0.2, 0.3), labels = c(-30, -20, -10, 0, 10, 20, 30))+
  scale_x_discrete(labels = c("Runs from human", "Indifference", "Approaches human"))+
  labs(title = "What behaviors towards humans were shown by adult vs. juvenile squirrels?", x = NULL, y = "Percentage difference between adult and juvenile behavior rates")+
  theme(legend.title = element_blank())

Q3: Are different color squirrels active in the morning vs the afternoon?

ggplot(sq_shift_color, aes(shift, count, fill = color))+
  geom_col(position = "dodge")+
  scale_fill_manual(values = c("Black" = "Black", "Cinnamon" = "darkorange3", "Gray" = "Grey"))+
  labs(title = "Sightings of different color squirrels in the morning vs after noon", x = NULL, y = "Number of sightings")

ggplot(sq_shift_color, aes(shift, count, fill = color))+
  geom_col(position = "fill")+
  scale_fill_manual(values = c("Black" = "Black", "Cinnamon" = "darkorange3", "Gray" = "Grey"))+
  labs(title = "Rate of sightings of different color squirrels in the morning vs after noon", x = NULL, y = "Percentage of sightings")

Final Versions:

Q1: Where are different color squirrels seen more or less frequently?

  ggplot(sq_sum, aes(e_w, n_s, fill = total))+
    geom_tile()+
    scale_fill_continuous(type = "viridis")+
    coord_fixed(ratio = 1)+
    facet_wrap(sq_sum$color, 1, 3)+
    scale_y_discrete(limits = rev)+
    labs(title = "Where different color squirrels are seen most frequently", x = "East - West Hectare Coordinate", y = "North - South Hectare Coordinate")
This plot attempts to answer the question: 'Where are different color squirrels seen more or less frequently?' It shows that there definitely are spots with more squirrels of a particular color than others. Although there are far fewer black and cinnamon squirrels than there are gray ones overall, the facets reveal which areas are hotspots for squirrels of those colors.

This plot attempts to answer the question: ‘Where are different color squirrels seen more or less frequently?’ It shows that there definitely are spots with more squirrels of a particular color than others. Although there are far fewer black and cinnamon squirrels than there are gray ones overall, the facets reveal which areas are hotspots for squirrels of those colors.

Q2: Is there any connection between squirrels’ ages and their interactions with humans?

ggplot(sq_behavior, aes(age, num, fill = action))+
  geom_col(position = "fill")+
  scale_fill_grey(name = "Behavior", labels = c("Approaches human", "Indifference", "Runs from human"))+
  labs(title = "What behaviors towards humans were shown by adult vs. juvenile squirrels?", x = NULL, y = "Percentage of interactions in which a behavior was exhibited")
This plot attempts to answer the question: 'is there any connection between squirrels' ages and their interactions with humans?' While there are small differences between the rates that each behavior shows up in adult vs juvenile squirrels, none of those differences are particularly large.

This plot attempts to answer the question: ‘is there any connection between squirrels’ ages and their interactions with humans?’ While there are small differences between the rates that each behavior shows up in adult vs juvenile squirrels, none of those differences are particularly large.

Q3: Are different color squirrels active in the morning vs the afternoon?

ggplot(sq_shift_color, aes(shift, count, group = color, color = color))+
  geom_point(size = 4)+
  geom_line(size = 2)+
  scale_color_manual(values = c("Black" = "Black", "Cinnamon" = "darkorange3", "Gray" = "Grey"))+
  scale_x_discrete(position = "top")+
  labs(title = "Sightings of different color squirrels in the morning vs afternoon", x = NULL, y = "Number of sightings")+
  theme(axis.ticks.x = element_blank(), panel.grid.major.x = element_blank(), panel.grid.minor.x = element_blank())
This plot attempts to answer the question: 'Are different color squirrels active in the morning vs the afternoon?' This seems to be the case for gray squirrels, which are seen much more frequently during the afternoon. However, this does not seem to be true for cinnamon or black squirrels. The number of those squirrels seen does not change much in the afternoon compared to the morning.

This plot attempts to answer the question: ‘Are different color squirrels active in the morning vs the afternoon?’ This seems to be the case for gray squirrels, which are seen much more frequently during the afternoon. However, this does not seem to be true for cinnamon or black squirrels. The number of those squirrels seen does not change much in the afternoon compared to the morning.