Analysis of feeder visitation data for helmeted honeyeaters (hehos) at Yellingbo. We are comparing feeder use by wild-bred (Yellingbo; YB) versus captive-bred (Healesville Sanctuary; HS) individuals. The data come from cameras placed near individual feeders that enable recording of visits to feeders by colour-banded individuals, and interactions between those individuals and other birds.
Note: the feeder data has not been systematically captured. This means some feeders have had more monitoring than others, and feeders have been recorded at different times of the day. Also, individuals may vary in how long they were present at the study site (and thus were able to make use of feeders). This should be kept in mind when interpreting the results.
We use various datasets from feeder observations to address three research questions:
Question 1: do wild- and captive-bred birds differ in their use of feeders at Yellingbo? - how many feeders are used by birds of different origins? - how often do birds of different origins visit feeders? - does the range of feeders used and frequency of visitation differ by sex?
Question 2:
library(ggplot2)
library(dplyr)
library(plotrix)
library(reshape2)
library(tidyr)
library(ggrepel)
library(scales)
library(scatterpie)
knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE, tidy = TRUE)
The data are in a file with 2,377 feeder visits by 29 individuals as rows. For each row there are four descriptor columns: Feeder_ID (the feeder’s label), Bird_ID (bird identity), Bird_origin (HS or YB) and Sex (M/F). There are 13 captive-bred (HS) and 16 wild-bred (YB) birds in the dataset.
# load data
feeder <- read.csv("data/bird.feeder.csv")
head(feeder)
## Feeder_ID Bird_ID Bird_origin Sex
## 1 A01 LB/O-B YB F
## 2 A01 LB/O-B YB F
## 3 A01 M/W/DB-S HS M
## 4 A01 R/W/M-S HS M
## 5 A01 R/W/M-S HS M
## 6 A01 R/Y-LB YB M
We first create a summary file that shows how many feeders were visited by each bird (range 1-13).
# sumarise number of unique feeders visited by each bird
feeder.use <- feeder %>%
group_by(Bird_origin, Bird_ID, Sex) %>%
summarise(count_distinct = n_distinct(Feeder_ID))
feeder.use
## # A tibble: 29 × 4
## # Groups: Bird_origin, Bird_ID [29]
## Bird_origin Bird_ID Sex count_distinct
## <chr> <chr> <chr> <int>
## 1 HS DB/M/DB-S M 12
## 2 HS DB/M/Y-S M 9
## 3 HS DB/Y/LG-S M 11
## 4 HS LB/M/LG-S F 10
## 5 HS LG/DB/LG-S M 11
## 6 HS LG/R/LB-S M 8
## 7 HS LG/R/Y-S F 7
## 8 HS M/LG/M-S M 13
## 9 HS M/W/DB-S M 12
## 10 HS R/DB/LG-S M 9
## # ℹ 19 more rows
We can see the full range, with one bird recorded only at a single feeder, and one bird recorded at all 13 feeders.
What about the number of feeder visits made by each individual?
# total number visits to all feeders for each bird
bird.visits <- feeder %>%
group_by(Bird_origin, Bird_ID, Sex) %>%
summarise(n = n()) %>%
mutate(sum(n))
bird.visits
## # A tibble: 29 × 5
## # Groups: Bird_origin, Bird_ID [29]
## Bird_origin Bird_ID Sex n `sum(n)`
## <chr> <chr> <chr> <int> <int>
## 1 HS DB/M/DB-S M 91 91
## 2 HS DB/M/Y-S M 131 131
## 3 HS DB/Y/LG-S M 128 128
## 4 HS LB/M/LG-S F 121 121
## 5 HS LG/DB/LG-S M 176 176
## 6 HS LG/R/LB-S M 38 38
## 7 HS LG/R/Y-S F 104 104
## 8 HS M/LG/M-S M 285 285
## 9 HS M/W/DB-S M 164 164
## 10 HS R/DB/LG-S M 53 53
## # ℹ 19 more rows
The number of total visits recorded ranges from 6 to 285. We can also break this down by feeder.
# number of visits to each feeder by individual birds
feeder.visits <- feeder %>%
count(Bird_origin, Bird_ID, Feeder_ID)
feeder.visits
## Bird_origin Bird_ID Feeder_ID n
## 1 HS DB/M/DB-S A01 3
## 2 HS DB/M/DB-S A02 24
## 3 HS DB/M/DB-S A03 8
## 4 HS DB/M/DB-S A04 6
## 5 HS DB/M/DB-S A06 8
## 6 HS DB/M/DB-S A07 2
## 7 HS DB/M/DB-S A08 8
## 8 HS DB/M/DB-S A10 13
## 9 HS DB/M/DB-S A11 10
## 10 HS DB/M/DB-S A12 4
## 11 HS DB/M/DB-S A13 2
## 12 HS DB/M/DB-S A14 3
## 13 HS DB/M/Y-S A02 35
## 14 HS DB/M/Y-S A03 72
## 15 HS DB/M/Y-S A04 5
## 16 HS DB/M/Y-S A06 7
## 17 HS DB/M/Y-S A07 7
## 18 HS DB/M/Y-S A10 1
## 19 HS DB/M/Y-S A11 1
## 20 HS DB/M/Y-S A13 2
## 21 HS DB/M/Y-S A14 1
## 22 HS DB/Y/LG-S A01 4
## 23 HS DB/Y/LG-S A02 60
## 24 HS DB/Y/LG-S A03 12
## 25 HS DB/Y/LG-S A04 18
## 26 HS DB/Y/LG-S A06 17
## 27 HS DB/Y/LG-S A08 2
## 28 HS DB/Y/LG-S A10 5
## 29 HS DB/Y/LG-S A11 2
## 30 HS DB/Y/LG-S A12 4
## 31 HS DB/Y/LG-S A13 3
## 32 HS DB/Y/LG-S A14 1
## 33 HS LB/M/LG-S A01 3
## 34 HS LB/M/LG-S A02 1
## 35 HS LB/M/LG-S A03 2
## 36 HS LB/M/LG-S A04 1
## 37 HS LB/M/LG-S A06 3
## 38 HS LB/M/LG-S A07 85
## 39 HS LB/M/LG-S A10 12
## 40 HS LB/M/LG-S A11 3
## 41 HS LB/M/LG-S A12 6
## 42 HS LB/M/LG-S A14 5
## 43 HS LG/DB/LG-S A01 8
## 44 HS LG/DB/LG-S A02 23
## 45 HS LG/DB/LG-S A03 4
## 46 HS LG/DB/LG-S A04 3
## 47 HS LG/DB/LG-S A06 4
## 48 HS LG/DB/LG-S A07 77
## 49 HS LG/DB/LG-S A08 11
## 50 HS LG/DB/LG-S A09 1
## 51 HS LG/DB/LG-S A10 37
## 52 HS LG/DB/LG-S A11 7
## 53 HS LG/DB/LG-S A13 1
## 54 HS LG/R/LB-S A02 3
## 55 HS LG/R/LB-S A03 3
## 56 HS LG/R/LB-S A04 4
## 57 HS LG/R/LB-S A06 1
## 58 HS LG/R/LB-S A07 13
## 59 HS LG/R/LB-S A10 11
## 60 HS LG/R/LB-S A11 2
## 61 HS LG/R/LB-S A13 1
## 62 HS LG/R/Y-S A01 3
## 63 HS LG/R/Y-S A02 9
## 64 HS LG/R/Y-S A03 82
## 65 HS LG/R/Y-S A06 4
## 66 HS LG/R/Y-S A07 3
## 67 HS LG/R/Y-S A11 1
## 68 HS LG/R/Y-S A13 2
## 69 HS M/LG/M-S A01 4
## 70 HS M/LG/M-S A02 223
## 71 HS M/LG/M-S A03 8
## 72 HS M/LG/M-S A04 11
## 73 HS M/LG/M-S A06 2
## 74 HS M/LG/M-S A07 2
## 75 HS M/LG/M-S A08 3
## 76 HS M/LG/M-S A09 1
## 77 HS M/LG/M-S A10 9
## 78 HS M/LG/M-S A11 2
## 79 HS M/LG/M-S A12 12
## 80 HS M/LG/M-S A13 2
## 81 HS M/LG/M-S A14 6
## 82 HS M/W/DB-S A01 4
## 83 HS M/W/DB-S A02 99
## 84 HS M/W/DB-S A03 10
## 85 HS M/W/DB-S A04 11
## 86 HS M/W/DB-S A06 2
## 87 HS M/W/DB-S A07 1
## 88 HS M/W/DB-S A08 1
## 89 HS M/W/DB-S A10 15
## 90 HS M/W/DB-S A11 2
## 91 HS M/W/DB-S A12 12
## 92 HS M/W/DB-S A13 2
## 93 HS M/W/DB-S A14 5
## 94 HS R/DB/LG-S A02 1
## 95 HS R/DB/LG-S A03 7
## 96 HS R/DB/LG-S A04 1
## 97 HS R/DB/LG-S A07 17
## 98 HS R/DB/LG-S A09 1
## 99 HS R/DB/LG-S A10 14
## 100 HS R/DB/LG-S A11 4
## 101 HS R/DB/LG-S A12 1
## 102 HS R/DB/LG-S A14 7
## 103 HS R/W/M-S A01 8
## 104 HS R/W/M-S A02 32
## 105 HS R/W/M-S A03 5
## 106 HS R/W/M-S A04 4
## 107 HS R/W/M-S A06 2
## 108 HS R/W/M-S A07 29
## 109 HS R/W/M-S A08 6
## 110 HS R/W/M-S A10 46
## 111 HS R/W/M-S A11 6
## 112 HS R/W/M-S A12 1
## 113 HS Y/LB/Y-S A01 1
## 114 HS Y/LB/Y-S A02 79
## 115 HS Y/LB/Y-S A03 5
## 116 HS Y/LB/Y-S A04 4
## 117 HS Y/LB/Y-S A06 4
## 118 HS Y/LB/Y-S A07 1
## 119 HS Y/LB/Y-S A10 8
## 120 HS Y/LB/Y-S A11 3
## 121 HS Y/LB/Y-S A12 1
## 122 HS Y/LB/Y-S A13 1
## 123 HS Y/LB/Y-S A14 4
## 124 HS Y/R/LB-S A01 4
## 125 HS Y/R/LB-S A02 46
## 126 HS Y/R/LB-S A03 4
## 127 HS Y/R/LB-S A04 25
## 128 HS Y/R/LB-S A06 10
## 129 HS Y/R/LB-S A07 1
## 130 HS Y/R/LB-S A08 1
## 131 HS Y/R/LB-S A10 6
## 132 HS Y/R/LB-S A11 1
## 133 HS Y/R/LB-S A12 6
## 134 HS Y/R/LB-S A13 4
## 135 HS Y/R/LB-S A14 4
## 136 YB DB/M-W/S A01 13
## 137 YB DB/M-W/S A02 8
## 138 YB DB/M-W/S A03 1
## 139 YB DB/M-W/S A04 2
## 140 YB DB/M-W/S A06 11
## 141 YB DB/M-W/S A07 3
## 142 YB DB/M-W/S A10 2
## 143 YB DB/M-W/S A11 6
## 144 YB DB/M-W/S A12 2
## 145 YB DB/M-W/S A13 3
## 146 YB DB/M-W/S A14 7
## 147 YB Gold/LG-LG A01 5
## 148 YB Gold/LG-LG A04 4
## 149 YB Gold/LG-LG A06 4
## 150 YB Gold/LG-LG A07 4
## 151 YB Gold/LG-LG A08 4
## 152 YB Gold/LG-LG A10 2
## 153 YB Gold/LG-LG A11 2
## 154 YB Gold/W-LB A01 7
## 155 YB Gold/W-LB A02 17
## 156 YB Gold/W-LB A07 4
## 157 YB Gold/W-LB A08 1
## 158 YB Gold/W-LB A10 14
## 159 YB Gold/W-LB A11 6
## 160 YB Gold/W-LB A13 1
## 161 YB Gold/W-LB A14 2
## 162 YB LB/DB/LB-LB A01 1
## 163 YB LB/DB/LB-LB A02 1
## 164 YB LB/DB/LB-LB A03 1
## 165 YB LB/DB/LB-LB A07 1
## 166 YB LB/DB/LB-LB A08 89
## 167 YB LB/DB/LB-LB A09 1
## 168 YB LB/DB/LB-LB A11 2
## 169 YB LB/DB/LB-LB A13 2
## 170 YB LB/DB/LB-LB A14 5
## 171 YB LB/O-B A01 13
## 172 YB LB/O-B A02 8
## 173 YB LB/O-B A07 1
## 174 YB LB/O-B A08 1
## 175 YB LB/O-B A09 1
## 176 YB LB/O-B A10 2
## 177 YB LB/O-B A12 1
## 178 YB LB/O-B A14 6
## 179 YB LB/R/LB-R A10 2
## 180 YB LB/R/LB-R A14 9
## 181 YB LB/Y-LB A02 3
## 182 YB LB/Y-LB A10 9
## 183 YB LB/Y-LB A11 3
## 184 YB LB/Y-LB A12 5
## 185 YB LG/Gold-LB A03 1
## 186 YB LG/Gold-LB A11 7
## 187 YB M/R/M-W/S A01 1
## 188 YB M/R/M-W/S A02 1
## 189 YB M/R/M-W/S A03 1
## 190 YB M/R/M-W/S A04 31
## 191 YB M/R/M-W/S A06 10
## 192 YB M/R/M-W/S A10 2
## 193 YB M/R/M-W/S A11 2
## 194 YB O/M-P A01 6
## 195 YB O/M-P A02 7
## 196 YB O/M-P A04 2
## 197 YB O/M-P A06 1
## 198 YB O/M-P A07 3
## 199 YB O/M-P A08 3
## 200 YB O/M-P A09 1
## 201 YB O/M-P A10 18
## 202 YB O/M-P A11 1
## 203 YB O/M-P A12 2
## 204 YB O/M-P A14 4
## 205 YB P/LG/P-G A12 1
## 206 YB P/LG/P-G A13 3
## 207 YB P/LG/P-G A14 7
## 208 YB P/O-LB A11 6
## 209 YB R/W-LB A08 1
## 210 YB R/W-LB A10 3
## 211 YB R/W-LB A11 1
## 212 YB R/W-LB A12 5
## 213 YB R/W-LB A14 1
## 214 YB R/Y-LB A01 3
## 215 YB R/Y-LB A02 6
## 216 YB R/Y-LB A04 2
## 217 YB R/Y-LB A07 3
## 218 YB R/Y-LB A08 84
## 219 YB R/Y-LB A09 1
## 220 YB R/Y-LB A10 17
## 221 YB R/Y-LB A11 3
## 222 YB R/Y-LB A12 1
## 223 YB R/Y-LB A13 1
## 224 YB R/Y-LB A14 8
## 225 YB W/M/W-S A01 20
## 226 YB W/M/W-S A02 85
## 227 YB W/M/W-S A03 1
## 228 YB W/M/W-S A04 3
## 229 YB W/M/W-S A07 9
## 230 YB W/M/W-S A08 11
## 231 YB W/M/W-S A10 15
## 232 YB W/M/W-S A13 2
## 233 YB W/M/W-S A14 4
## 234 YB Y/LG-LB A04 1
## 235 YB Y/LG-LB A06 1
## 236 YB Y/LG-LB A08 8
# number of visits to feeders by birds of different origins
origin.feeder <- feeder %>%
count(Bird_origin, Feeder_ID)
origin.feeder
## Bird_origin Feeder_ID n
## 1 HS A01 42
## 2 HS A02 635
## 3 HS A03 222
## 4 HS A04 93
## 5 HS A06 64
## 6 HS A07 238
## 7 HS A08 32
## 8 HS A09 3
## 9 HS A10 177
## 10 HS A11 44
## 11 HS A12 47
## 12 HS A13 20
## 13 HS A14 36
## 14 YB A01 69
## 15 YB A02 136
## 16 YB A03 5
## 17 YB A04 45
## 18 YB A06 27
## 19 YB A07 28
## 20 YB A08 202
## 21 YB A09 4
## 22 YB A10 86
## 23 YB A11 39
## 24 YB A12 17
## 25 YB A13 12
## 26 YB A14 53
Number of visits to a single feeder by an individual ranges from 1 to 223!
To enable us to display various matrices, we create some subsets of the data (separate datafiles for HS and YB birds) and calculate proportions of visits across feeders.
# create subsets for each bird origin
HS.feeder.visits <- subset(feeder.visits, Bird_origin == "HS")
YB.feeder.visits <- subset(feeder.visits, Bird_origin == "YB")
# summarise and calculate proportions of visits across feeders for all birds
feeder.visits <- feeder %>%
group_by(Bird_ID, Feeder_ID) %>%
summarise(n = n()) %>%
mutate(freq = n/sum(n))
Let’s look at feeder visits in the form of a matrix: all visits to all feeders by all birds.
# plot a matrix showing visit counts to each feeder by each bird
visit.counts <- acast(feeder.visits, Bird_ID ~ Feeder_ID, value.var = "n", fun.aggregate = sum,
margins = TRUE)
visit.counts
## A01 A02 A03 A04 A06 A07 A08 A09 A10 A11 A12 A13 A14 (all)
## DB/M-W/S 13 8 1 2 11 3 0 0 2 6 2 3 7 58
## DB/M/DB-S 3 24 8 6 8 2 8 0 13 10 4 2 3 91
## DB/M/Y-S 0 35 72 5 7 7 0 0 1 1 0 2 1 131
## DB/Y/LG-S 4 60 12 18 17 0 2 0 5 2 4 3 1 128
## Gold/LG-LG 5 0 0 4 4 4 4 0 2 2 0 0 0 25
## Gold/W-LB 7 17 0 0 0 4 1 0 14 6 0 1 2 52
## LB/DB/LB-LB 1 1 1 0 0 1 89 1 0 2 0 2 5 103
## LB/M/LG-S 3 1 2 1 3 85 0 0 12 3 6 0 5 121
## LB/O-B 13 8 0 0 0 1 1 1 2 0 1 0 6 33
## LB/R/LB-R 0 0 0 0 0 0 0 0 2 0 0 0 9 11
## LB/Y-LB 0 3 0 0 0 0 0 0 9 3 5 0 0 20
## LG/DB/LG-S 8 23 4 3 4 77 11 1 37 7 0 1 0 176
## LG/Gold-LB 0 0 1 0 0 0 0 0 0 7 0 0 0 8
## LG/R/LB-S 0 3 3 4 1 13 0 0 11 2 0 1 0 38
## LG/R/Y-S 3 9 82 0 4 3 0 0 0 1 0 2 0 104
## M/LG/M-S 4 223 8 11 2 2 3 1 9 2 12 2 6 285
## M/R/M-W/S 1 1 1 31 10 0 0 0 2 2 0 0 0 48
## M/W/DB-S 4 99 10 11 2 1 1 0 15 2 12 2 5 164
## O/M-P 6 7 0 2 1 3 3 1 18 1 2 0 4 48
## P/LG/P-G 0 0 0 0 0 0 0 0 0 0 1 3 7 11
## P/O-LB 0 0 0 0 0 0 0 0 0 6 0 0 0 6
## R/DB/LG-S 0 1 7 1 0 17 0 1 14 4 1 0 7 53
## R/W-LB 0 0 0 0 0 0 1 0 3 1 5 0 1 11
## R/W/M-S 8 32 5 4 2 29 6 0 46 6 1 0 0 139
## R/Y-LB 3 6 0 2 0 3 84 1 17 3 1 1 8 129
## W/M/W-S 20 85 1 3 0 9 11 0 15 0 0 2 4 150
## Y/LB/Y-S 1 79 5 4 4 1 0 0 8 3 1 1 4 111
## Y/LG-LB 0 0 0 1 1 0 8 0 0 0 0 0 0 10
## Y/R/LB-S 4 46 4 25 10 1 1 0 6 1 6 4 4 112
## (all) 111 771 227 138 91 266 234 7 263 83 64 32 89 2376
There’s clearly variation in the ‘popularity’ of feeders, with overall visit counts ranging from 7 to 771. Keep in mind that this could simply be due to different feeders being recorded for different amounts of time. [If we know deployment time for each feeder, we can correct for that]
We can also visualise this as proportions.
# plot a matrix showing proportion of visits to feeders visited by each bird
visit.props <- acast(feeder.visits, Bird_ID ~ Feeder_ID, value.var = "freq", fun.aggregate = sum,
margins = TRUE)
# can round if you want using: round(visit.props, digits = 2)
visit.props
## A01 A02 A03 A04 A06
## DB/M-W/S 0.224137931 0.137931034 0.017241379 0.034482759 0.189655172
## DB/M/DB-S 0.032967033 0.263736264 0.087912088 0.065934066 0.087912088
## DB/M/Y-S 0.000000000 0.267175573 0.549618321 0.038167939 0.053435115
## DB/Y/LG-S 0.031250000 0.468750000 0.093750000 0.140625000 0.132812500
## Gold/LG-LG 0.200000000 0.000000000 0.000000000 0.160000000 0.160000000
## Gold/W-LB 0.134615385 0.326923077 0.000000000 0.000000000 0.000000000
## LB/DB/LB-LB 0.009708738 0.009708738 0.009708738 0.000000000 0.000000000
## LB/M/LG-S 0.024793388 0.008264463 0.016528926 0.008264463 0.024793388
## LB/O-B 0.393939394 0.242424242 0.000000000 0.000000000 0.000000000
## LB/R/LB-R 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000
## LB/Y-LB 0.000000000 0.150000000 0.000000000 0.000000000 0.000000000
## LG/DB/LG-S 0.045454545 0.130681818 0.022727273 0.017045455 0.022727273
## LG/Gold-LB 0.000000000 0.000000000 0.125000000 0.000000000 0.000000000
## LG/R/LB-S 0.000000000 0.078947368 0.078947368 0.105263158 0.026315789
## LG/R/Y-S 0.028846154 0.086538462 0.788461538 0.000000000 0.038461538
## M/LG/M-S 0.014035088 0.782456140 0.028070175 0.038596491 0.007017544
## M/R/M-W/S 0.020833333 0.020833333 0.020833333 0.645833333 0.208333333
## M/W/DB-S 0.024390244 0.603658537 0.060975610 0.067073171 0.012195122
## O/M-P 0.125000000 0.145833333 0.000000000 0.041666667 0.020833333
## P/LG/P-G 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000
## P/O-LB 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000
## R/DB/LG-S 0.000000000 0.018867925 0.132075472 0.018867925 0.000000000
## R/W-LB 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000
## R/W/M-S 0.057553957 0.230215827 0.035971223 0.028776978 0.014388489
## R/Y-LB 0.023255814 0.046511628 0.000000000 0.015503876 0.000000000
## W/M/W-S 0.133333333 0.566666667 0.006666667 0.020000000 0.000000000
## Y/LB/Y-S 0.009009009 0.711711712 0.045045045 0.036036036 0.036036036
## Y/LG-LB 0.000000000 0.000000000 0.000000000 0.100000000 0.100000000
## Y/R/LB-S 0.035714286 0.410714286 0.035714286 0.223214286 0.089285714
## (all) 1.568837632 5.708550426 2.155247442 1.805351601 1.224202436
## A07 A08 A09 A10 A11
## DB/M-W/S 0.051724138 0.000000000 0.000000000 0.034482759 0.103448276
## DB/M/DB-S 0.021978022 0.087912088 0.000000000 0.142857143 0.109890110
## DB/M/Y-S 0.053435115 0.000000000 0.000000000 0.007633588 0.007633588
## DB/Y/LG-S 0.000000000 0.015625000 0.000000000 0.039062500 0.015625000
## Gold/LG-LG 0.160000000 0.160000000 0.000000000 0.080000000 0.080000000
## Gold/W-LB 0.076923077 0.019230769 0.000000000 0.269230769 0.115384615
## LB/DB/LB-LB 0.009708738 0.864077670 0.009708738 0.000000000 0.019417476
## LB/M/LG-S 0.702479339 0.000000000 0.000000000 0.099173554 0.024793388
## LB/O-B 0.030303030 0.030303030 0.030303030 0.060606061 0.000000000
## LB/R/LB-R 0.000000000 0.000000000 0.000000000 0.181818182 0.000000000
## LB/Y-LB 0.000000000 0.000000000 0.000000000 0.450000000 0.150000000
## LG/DB/LG-S 0.437500000 0.062500000 0.005681818 0.210227273 0.039772727
## LG/Gold-LB 0.000000000 0.000000000 0.000000000 0.000000000 0.875000000
## LG/R/LB-S 0.342105263 0.000000000 0.000000000 0.289473684 0.052631579
## LG/R/Y-S 0.028846154 0.000000000 0.000000000 0.000000000 0.009615385
## M/LG/M-S 0.007017544 0.010526316 0.003508772 0.031578947 0.007017544
## M/R/M-W/S 0.000000000 0.000000000 0.000000000 0.041666667 0.041666667
## M/W/DB-S 0.006097561 0.006097561 0.000000000 0.091463415 0.012195122
## O/M-P 0.062500000 0.062500000 0.020833333 0.375000000 0.020833333
## P/LG/P-G 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000
## P/O-LB 0.000000000 0.000000000 0.000000000 0.000000000 1.000000000
## R/DB/LG-S 0.320754717 0.000000000 0.018867925 0.264150943 0.075471698
## R/W-LB 0.000000000 0.090909091 0.000000000 0.272727273 0.090909091
## R/W/M-S 0.208633094 0.043165468 0.000000000 0.330935252 0.043165468
## R/Y-LB 0.023255814 0.651162791 0.007751938 0.131782946 0.023255814
## W/M/W-S 0.060000000 0.073333333 0.000000000 0.100000000 0.000000000
## Y/LB/Y-S 0.009009009 0.000000000 0.000000000 0.072072072 0.027027027
## Y/LG-LB 0.000000000 0.800000000 0.000000000 0.000000000 0.000000000
## Y/R/LB-S 0.008928571 0.008928571 0.000000000 0.053571429 0.008928571
## (all) 2.621199185 2.986271688 0.096655554 3.629514455 2.953682479
## A12 A13 A14 (all)
## DB/M-W/S 0.034482759 0.051724138 0.120689655 1
## DB/M/DB-S 0.043956044 0.021978022 0.032967033 1
## DB/M/Y-S 0.000000000 0.015267176 0.007633588 1
## DB/Y/LG-S 0.031250000 0.023437500 0.007812500 1
## Gold/LG-LG 0.000000000 0.000000000 0.000000000 1
## Gold/W-LB 0.000000000 0.019230769 0.038461538 1
## LB/DB/LB-LB 0.000000000 0.019417476 0.048543689 1
## LB/M/LG-S 0.049586777 0.000000000 0.041322314 1
## LB/O-B 0.030303030 0.000000000 0.181818182 1
## LB/R/LB-R 0.000000000 0.000000000 0.818181818 1
## LB/Y-LB 0.250000000 0.000000000 0.000000000 1
## LG/DB/LG-S 0.000000000 0.005681818 0.000000000 1
## LG/Gold-LB 0.000000000 0.000000000 0.000000000 1
## LG/R/LB-S 0.000000000 0.026315789 0.000000000 1
## LG/R/Y-S 0.000000000 0.019230769 0.000000000 1
## M/LG/M-S 0.042105263 0.007017544 0.021052632 1
## M/R/M-W/S 0.000000000 0.000000000 0.000000000 1
## M/W/DB-S 0.073170732 0.012195122 0.030487805 1
## O/M-P 0.041666667 0.000000000 0.083333333 1
## P/LG/P-G 0.090909091 0.272727273 0.636363636 1
## P/O-LB 0.000000000 0.000000000 0.000000000 1
## R/DB/LG-S 0.018867925 0.000000000 0.132075472 1
## R/W-LB 0.454545455 0.000000000 0.090909091 1
## R/W/M-S 0.007194245 0.000000000 0.000000000 1
## R/Y-LB 0.007751938 0.007751938 0.062015504 1
## W/M/W-S 0.000000000 0.013333333 0.026666667 1
## Y/LB/Y-S 0.009009009 0.009009009 0.036036036 1
## Y/LG-LB 0.000000000 0.000000000 0.000000000 1
## Y/R/LB-S 0.053571429 0.035714286 0.035714286 1
## (all) 1.238370361 0.560031962 2.452084779 29
Let’s now create separate matrices for HS and YB birds. First, the HS (captive-bred) birds.
HS.visit.counts <- acast(HS.feeder.visits, Bird_ID ~ Feeder_ID, value.var = "n",
fun.aggregate = sum, margins = TRUE)
HS.visit.counts
## A01 A02 A03 A04 A06 A07 A08 A09 A10 A11 A12 A13 A14 (all)
## DB/M/DB-S 3 24 8 6 8 2 8 0 13 10 4 2 3 91
## DB/M/Y-S 0 35 72 5 7 7 0 0 1 1 0 2 1 131
## DB/Y/LG-S 4 60 12 18 17 0 2 0 5 2 4 3 1 128
## LB/M/LG-S 3 1 2 1 3 85 0 0 12 3 6 0 5 121
## LG/DB/LG-S 8 23 4 3 4 77 11 1 37 7 0 1 0 176
## LG/R/LB-S 0 3 3 4 1 13 0 0 11 2 0 1 0 38
## LG/R/Y-S 3 9 82 0 4 3 0 0 0 1 0 2 0 104
## M/LG/M-S 4 223 8 11 2 2 3 1 9 2 12 2 6 285
## M/W/DB-S 4 99 10 11 2 1 1 0 15 2 12 2 5 164
## R/DB/LG-S 0 1 7 1 0 17 0 1 14 4 1 0 7 53
## R/W/M-S 8 32 5 4 2 29 6 0 46 6 1 0 0 139
## Y/LB/Y-S 1 79 5 4 4 1 0 0 8 3 1 1 4 111
## Y/R/LB-S 4 46 4 25 10 1 1 0 6 1 6 4 4 112
## (all) 42 635 222 93 64 238 32 3 177 44 47 20 36 1653
Then the YB (wild-bred) birds.
YB.visit.counts <- acast(YB.feeder.visits, Bird_ID ~ Feeder_ID, value.var = "n",
fun.aggregate = sum, margins = TRUE)
YB.visit.counts
## A01 A02 A03 A04 A06 A07 A08 A09 A10 A11 A12 A13 A14 (all)
## DB/M-W/S 13 8 1 2 11 3 0 0 2 6 2 3 7 58
## Gold/LG-LG 5 0 0 4 4 4 4 0 2 2 0 0 0 25
## Gold/W-LB 7 17 0 0 0 4 1 0 14 6 0 1 2 52
## LB/DB/LB-LB 1 1 1 0 0 1 89 1 0 2 0 2 5 103
## LB/O-B 13 8 0 0 0 1 1 1 2 0 1 0 6 33
## LB/R/LB-R 0 0 0 0 0 0 0 0 2 0 0 0 9 11
## LB/Y-LB 0 3 0 0 0 0 0 0 9 3 5 0 0 20
## LG/Gold-LB 0 0 1 0 0 0 0 0 0 7 0 0 0 8
## M/R/M-W/S 1 1 1 31 10 0 0 0 2 2 0 0 0 48
## O/M-P 6 7 0 2 1 3 3 1 18 1 2 0 4 48
## P/LG/P-G 0 0 0 0 0 0 0 0 0 0 1 3 7 11
## P/O-LB 0 0 0 0 0 0 0 0 0 6 0 0 0 6
## R/W-LB 0 0 0 0 0 0 1 0 3 1 5 0 1 11
## R/Y-LB 3 6 0 2 0 3 84 1 17 3 1 1 8 129
## W/M/W-S 20 85 1 3 0 9 11 0 15 0 0 2 4 150
## Y/LG-LB 0 0 0 1 1 0 8 0 0 0 0 0 0 10
## (all) 69 136 5 45 27 28 202 4 86 39 17 12 53 723
Interesting to note that all feeders were visited by both captive-bred (HS) and wild-bred (YB) individuals. Comparing these matrices, it seems clear that the 13 captive-bred (HS) individuals are using the feeders much more frequently than the 16 wild-bred (YB) birds (1,653 visits by 13 birds versus 723 visits by 16 birds). We can do an ANOVA to look at the means for each group.
First, number of feeders used.
## Df Sum Sq Mean Sq F value Pr(>F)
## Bird_origin 1 118.9 118.93 14.7 0.000686 ***
## Residuals 27 218.5 8.09
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Tables of means
## Grand mean
##
## 8.137931
##
## Bird_origin
## HS YB
## 10.4 6.31
## rep 13.0 16.00
The captive-bred (HS) birds are using 10.4 feeders on average, compared to 6.3 for the wild-bred (YB) birds.
Does this differ by sex?
## Df Sum Sq Mean Sq F value Pr(>F)
## Bird_origin 1 118.93 118.93 14.350 0.000852 ***
## Sex 1 11.31 11.31 1.365 0.253667
## Bird_origin:Sex 1 0.00 0.00 0.000 1.000000
## Residuals 25 207.20 8.29
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Tables of means
## Grand mean
##
## 8.137931
##
## Bird_origin
## HS YB
## 10.4 6.31
## rep 13.0 16.00
##
## Sex
## F M
## 7.5 8.66
## rep 13.0 16.00
##
## Bird_origin:Sex
## Sex
## Bird_origin F M
## HS 9.33 10.70
## rep 3.00 10.00
## YB 5.80 7.17
## rep 10.00 6.00
No significant effect of Sex. Plot the data.
What about the overall number of visits to feeders?
## Df Sum Sq Mean Sq F value Pr(>F)
## Bird_origin 1 48188 48188 17.33 0.000287 ***
## Residuals 27 75066 2780
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Tables of means
## Grand mean
##
## 81.93103
##
## Bird_origin
## HS YB
## 127 45.2
## rep 13 16.0
Around 127 feeder visits on average per captive-bred (HS) bird, compared to 45 per wild-bred (YB) bird.
Does this differ by sex?
## Df Sum Sq Mean Sq F value Pr(>F)
## Bird_origin 1 48188 48188 16.834 0.00038 ***
## Sex 1 3439 3439 1.201 0.28349
## Bird_origin:Sex 1 63 63 0.022 0.88280
## Residuals 25 71564 2863
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Tables of means
## Grand mean
##
## 81.93103
##
## Bird_origin
## HS YB
## 127 45.2
## rep 13 16.0
##
## Sex
## F M
## 70.8 91
## rep 13.0 16
##
## Bird_origin:Sex
## Sex
## Bird_origin F M
## HS 112.0 131.7
## rep 3.0 10.0
## YB 35.3 61.7
## rep 10.0 6.0
No significant effect of Sex. Plot the data.
No difference.
Overall, the data suggest more frequent visitation to feeders and greater variety of feeders used by HS (captive-bred) birds. This assumes there are no systematic differences between HS and YB birds in terms of how long they were present at the site. We now draw on another datafile to explore how long birds stayed at the site.
Plot the presence of different individuals visually, using origin as a colour differentiator.
Looks like the captive-bred (Healesville) birds generally persisted onsite for longer than the Yellingbo birds. 3 Healesville birds disappeared shortly after (<two months) release, while 9 Yellingbo birds did. At last check there were still 9 Healesville birds definitely on site but only 2 Yellingbo birds.
Compare average site tenancy for birds from the two natal sites
## Df Sum Sq Mean Sq F value Pr(>F)
## Natal_site 1 1225638 1225638 9.436 0.0045 **
## Residuals 30 3896654 129888
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Tables of means
## Grand mean
##
## 482.875
##
## Natal_site
## Healesville Yellingbo
## 705 310
## rep 14 18
Healesville birds had a mean tenancy of 705 days compared to 310 for Yellingbo birds. This is a problem because we might have more feeder visits by captive-bred birds simply because more of them were around.
Let’s explore how HS and YB birds used different feeders and see if there are broad or individual differences in patterns of feeder use. We first create two facet plots side by side that allow us to visually compare overall feeder use. We’ll display the spatial arrangement of the feeders by plotting them according to lat/lon, and create a bubble chart where the size of the bubble represents the number of visits to that feeder.
Another way of displaying the data is to segment each bubble into pie pieces that represent visits by individuals from the two source populations.
Healesville birds doing the lion’s share of feeding at most feeders,
except for A08.
We can also show this pattern for individual birds, sorted by origin. But it’s a bit of a mess.
#OTHER METHOD
feeder.birds<-read.csv(“data/feeder.birds.csv”) p <- ggplot() + geom_scatterpie(data=feeder.birds, aes(x=lon, y=lat, group=feeder, r=(total)0.1), cols=LETTERS[1:26], color=NA) + coord_equal() p + geom_scatterpie_legend(feeder.birds$total0.03, x=-145.78, y=-37.72) ```
#pie_bubbles<-function(xpos,ypos,radii,sectors, sector_col=NULL,main=““,xlab=”“,ylab=”“) { xlim<-c(min(xpos-radii),max(xpos+radii)) ylim<-c(min(ypos-radii),max(ypos+radii)) nbubbles<-length(xpos) if(is.null(sector_col)) { sector_col<-list() for(scol in 1:nbubbles) sector_col[[scol]]<-rainbow(length(sectors[[scol]])) } plot(0,xlim=xlim,ylim=ylim,type=”n”, main=main,xlab=xlab,ylab=ylab) for(bubble in 1:nbubbles) floating.pie(xpos=xpos[bubble],ypos=ypos[bubble], x=sectors[[bubble]],radius=radii[bubble], col=sector_col[[bubble]])
#library(plotrix) #pie_bubbles(lat,ypos,radii,sectors,main=“Pie bubbles”)