-
Notifications
You must be signed in to change notification settings - Fork 0
/
analyses.Rmd
2888 lines (2498 loc) · 125 KB
/
analyses.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
title: "Detecting trait differences between a reintroduced and a dispersing eastern quoll population"
author: "Christina Gee"
date: "6 June 2024"
output:
html_document:
toc: true
number_sections: true
toc_depth: 3
toc_float:
collapsed: true
theme: cerulean
highlight: pygments
editor_options:
chunk_output_type: console
knit: (function(inputFile, encoding) { rmarkdown::render(inputFile, encoding = encoding, output_file = file.path(dirname(inputFile), 'tutorial.html')) })
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo=TRUE, eval=TRUE)
```
# * Background
Earth is suffering a biodiversity crisis due to anthropogenic threats including invasive species, habitat destruction, climate change, and human persecution. Important tools for addressing biodiversity loss are creating havens that exclude key threats and restoring the ecosystems within those havens using wildlife reintroductions. However, 25–50% of reintroductions have failed to create self-sustaining populations, due to a number of factors such as poor planning, under-funding, selecting inappropriate founders, failure to address initial causes of decline, and a lack of ongoing post-release monitoring.
Best-practice reintroduction guidelines published by the International Union for the Conservation of Nature state that founders should be selected on the basis of genetic, morphological, physiological, and behavioural representativeness. Each category is important, but several studies have shown the vital influence of individual behavioural syndromes (i.e., personality and plasticity) on reintroduction outcomes. Despite this, there are no known documented cases of selecting founders on the basis of personality and plasticity. This may be due to a lack of rapid field-based behavioural assessment (assay) methods available to practitioners. Most personality studies are conducted in a laboratory environment which is costly and time-intensive and can be stressful and invasive for the animals being assessed.
To address this problem, I designed and tested behavioural assay arenas for use in the field and conducted assays on two eastern quoll (*Dasyurus viverrinus*) populations at Mulligans Flat Woodland Sanctuary (MFWS) and Goorooyarroo Sanctuary (GS), to investigate how differences in personality and plasticity influence population dynamics for this endangered marsupial mesopredator, with a view to understand how knowledge of these differences can inform future reintroductions. I found significant demographic, morphological, and behavioural differences between the eastern quolls of MFWS and GS. The individuals at MFWS were more likely to be behaviourally proactive (lower latencies to emerge, greater activity levels) and plastic (more able to change behaviour over time). Individuals at GS were more likely to be reactive (greater latencies to emerge, and lower activity levels) and more rigid. These quolls were also more likely to be heavier, have greater body condition scores, and aged 1–2 years old (as opposed to MFWS where their ages covered the full life expectancy of up to 3–4 years old).
Understanding how personality and plasticity differences in individual animals affects reintroductions and ecosystem restoration is still in its infancy, but I have demonstrated a method for conducting rapid behavioural assessments in the field. This provides practitioners with a tool to explore behavioural syndromes and how they influence reintroduction outcomes and population dynamics.
# * Setup
First, I installed the [pacman Package Management Tool](https://cran.r-project.org/web/packages/pacman/index.html), which allows us to install and load subsequent packages in a condensed and efficient way.
```{r, eval=FALSE}
#install.packages("pacman")
```
# Install packages
```{r, results='hide', warning=FALSE, message=FALSE}
# Install and load required packages
pacman::p_load(ggplot2, ggpubr, gtools, janitor, lme4,lmerTest, MuMIn,
readr, sf, readxl, rstudioapi, tidyverse, viridis, corrplot,
broom, sjPlot, sjmisc, sjlabelled, knitr, kableExtra, broom.mixed,
AICcmodavg, scales)
```
# Data preparation
```{r, eval=FALSE}
# Assign raw data filename to an object
raw_data <- "data.xlsx"
# Read in behavioural assay data
raw <- read_excel(raw_data, sheet="Assays", na="N/A") %>%
clean_names() %>%
select("obs_id"="observation_id",
"assay_id",
"quoll_code",
behaviour="behavior",
occurrences="total_number_of_occurences")
#Read in the data for all data sheets in excel
meta <- read_excel(raw_data, sheet="Metadata", na="N/A") %>%
clean_names()
quoll <- read_excel(raw_data, sheet="Quoll", na="N/A") %>%
clean_names()
capture <- read_excel(raw_data, sheet="Captures") %>%
clean_names()
session <- read_excel(raw_data, sheet="Sessions") %>%
clean_names()
#Clean up behaviour data from long to wide format
occ <- pivot_wider(data = raw,
names_from = behaviour,
values_from = occurrences) %>%
clean_names() %>%
mutate(across(all_of(c("section_1", "section_2", "section_3", "section_4",
"moving", "jump_climb", "food", "legs",
"grooming", "resting", "perch")), as.numeric)) %>%
rename(section_1_o = "section_1",
section_2_o = "section_2",
section_3_o = "section_3",
section_4_o = "section_4",
moving_o = "moving",
jump_climb_o = "jump_climb",
food_o = "food",
legs_o = "legs",
grooming_o = "grooming",
resting_o = "resting",
perch_o = "perch")
raw <- read_excel(raw_data, sheet="Assays", , na="N/A") %>%
clean_names() %>%
select("obs_id"="observation_id",
"assay_id",
quoll_code,
behaviour="behavior",
duration="total_duration_s")
dur <- pivot_wider(data = raw,
names_from = behaviour,
values_from = duration) %>%
clean_names() %>%
mutate(across(all_of(c("section_1", "section_2", "section_3", "section_4",
"moving", "jump_climb", "food", "legs",
"grooming", "resting", "perch")), as.numeric)) %>%
rename(section_1_d = "section_1",
section_2_d = "section_2",
section_3_d = "section_3",
section_4_d = "section_4",
moving_d = "moving",
jump_climb_d = "jump_climb",
food_d = "food",
legs_d = "legs",
grooming_d = "grooming",
resting_d = "resting",
perch_d = "perch")
assays <- left_join(occ, dur, by=c("obs_id", "assay_id", "quoll_code"))
#Adding all sections together to create a column with total section visitations
assays$sumsect_o <- rowSums(assays[, c("section_1_o", "section_2_o", "section_3_o", "section_4_o")])
#Adding together all activity occurrences without sections
assays$totalact_o <- rowSums(assays[, c(4:10)])
#view(assays)
# Append metadata for each assay to dataframe
behavdata <- left_join(meta, assays, by=c("assay_id", "quoll_code"))%>%
filter(!is.na(assay_number))
behavdata <- left_join(behavdata, session, by=c("session"))%>%
filter(!is.na(assay_number))
quolldata <- left_join(capture, quoll, by=c("quoll_code"))
data <- left_join(behavdata, quolldata, by=c("session", "quoll_code"))
data <- data %>%
select(-min_temp, -session_desc, -capture_date, -new_animal) %>%
mutate(assay_number = as.factor(assay_number),
cond_n = as.numeric(ifelse(condition=="Excellent", 4,
ifelse(condition=="Good", 3,
ifelse(condition=="Fair", 2, NA)))),
age_n = as.numeric(ifelse(age_estimate=="<1yr", 0,
ifelse(age_estimate=="1-2yrs", 1,
ifelse(age_estimate=="2-3yrs", 2, NA)))))
```
# Calculating time differences
```{r}
#Change time columns to correct POSIXct format
data$snout <- as.POSIXct(data$snout)
data$process_end <- as.POSIXct(data$process_end)
data$first_light <- as.POSIXct(data$first_light)
#Calculate time differences
data$time_processtoassay <- data$snout - data$process_end
data$time_assaytolight <- data$first_light - data$snout
#Filtering out the two individuals who were assayed in Sept 2023
data <- data %>%
filter(!(quoll_code %in% c("53328", "87DE0")))
```
I conducted a correlation analysis for morphological traits, so I could reduce the number of variables.
# Correlation analysis
```{r}
cor <- data %>%
dplyr::select(age_n, body_weight_kg, cond_n, pes_mean_mm, head_length_mm)
#Running the correlation test
cor <- cor(cor)
view(cor)
#Saving them to a .csv file
write.csv(cor, "data - morphometric correlation matrix.csv")
#Creating and printing correlation matrix .jpgs which colour code the correlations
col_names <- c("Age estimate", "Body weight (kg)", "Condition", "Pes length (mm)", "Head length (mm)")
row_names <- c("Age estimate", "Body weight (kg)", "Condition", "Pes length (mm)", "Head length (mm)")
colnames(cor) <- col_names
rownames(cor) <- row_names
#Correlation of occurrences and duration with sections
jpeg(height=2000, width=2000, file="data corplot.jpeg", type="cairo")
corrplot(cor, method="color",
col= colorRampPalette(c("#B8DE29", "#FFFFFF","#2D718E"))(10),
type="upper", #creates a correlation matrix
cl.cex=3, number.cex=4, tl.cex=4, diag=FALSE,
tl.col="black", tl.srt=45, addCoef.col="black")
dev.off()
```
#** SINGLE ASSAYS
I created a data subset to test the demographic, morphometric and behavioural variables for the first assay for all 36 individual eastern quolls.
# Subsetting data to include first assays only
```{r}
data1 <- data %>%
filter(assay_number !=2)
data1$site01 <- ifelse(data1$study_site == "Goorooyarroo", 1, 0)
write.csv(data1, "data1 - first assay data raw.csv")
```
I ensured that the data frame is in the format needed.
```{r}
data1 <- data1 %>%
mutate(age_n = as.numeric(as.character(age_n)),
condition = factor(condition,
levels = c("Excellent", "Good", "Fair", "Poor")))
data1 <- data1 %>%
# assign as factor
mutate(age_estimate = as.factor(age_estimate)) %>%
# Assign new labels
mutate(age_estimate = recode(age_estimate,
"1-2yrs" = "1–2 years",
"<1yr" = "<1 year",
"2-3yrs" = "2–3 years")) %>%
# reorder new labels
mutate(age_estimate = factor(age_estimate,
levels = c("2–3 years", "1–2 years", "<1 year")))
```
#Demo/morpho analysis
```{r}
#GLM
mod <- glm(site01 ~ sex + body_weight_kg + age_n + cond_n,
data=data1, family=binomial)
summary(mod)
```
#Extract demo/morpho table with kableExtra
```{r}
tidy_results <- tidy(mod) %>%
mutate_if(is.numeric, ~round(., digits = 3))
table <- tidy_results %>%
mutate(p.value = ifelse(p.value <= 0.05, cell_spec(p.value, bold = TRUE), p.value)) %>%
kbl(caption = "Study site", escape = FALSE) %>%
kable_classic(full_width = F, html_font = "Times New Roman") %>%
kable_styling(bootstrap_options = "striped", font_size = 15)
table
```
#Demo/morpho plots
```{r}
str(data1)
mutate(as.numeric(data1$site01))
#Age plot
age_plot <- ggplot() +
geom_smooth(data=data1, aes(x=age_n, y=site01), colour = "#1caa85", fill = "#68C6AE" ) +
theme_minimal() +
theme(panel.grid = element_blank(),
axis.line.x = element_line(color = "black"),
axis.line.y = element_line(color = "black"),
text = element_text(size=16)) +
scale_y_continuous(breaks=seq(-0.4,1,0.2),labels=seq(-0.4,1,0.2), limits=c(-0.4,1)) +
ylab("Probability of capture in MF (0) or GS (1)") +
xlab("Age estimate") +
annotate("text", x = 1.9, y =0.95, label = "A", size = 8, hjust = 1)
#Condition plot
cond_plot <- ggplot() +
geom_smooth(data=data1, aes(x=cond_n, y=site01), colour = "#2D718E", fill = "#5089A1") +
theme_minimal() +
theme(panel.grid = element_blank(),
axis.line.x = element_line(color = "black"),
axis.line.y = element_line(color = "black"),
text = element_text(size=16)) +
scale_y_continuous(breaks=seq(-0.4,1,0.2),labels=seq(-0.4,1,0.2), limits=c(-0.4,1)) +
ylab(" ") +
xlab("Body condition score")+
annotate("text", x = 3.9, y =0.95, label = "C", size = 8, hjust = 1)
weight_plot <- ggplot() +
geom_smooth(data=data1, aes(x=body_weight_kg, y=site01), colour = "#482677", fill = "#674A8E") +
theme_minimal() +
theme(panel.grid = element_blank(),
axis.line.x = element_line(color = "black"),
axis.line.y = element_line(color = "black"),
text = element_text(size=16)) +
scale_y_continuous(breaks=seq(-0.4,1,0.2),labels=seq(-0.4,1,0.2), limits=c(-0.4,1)) +
#scale_x_continuous(breaks=seq(0, 2, 0.5), labels=seq(0,2,0.5), limits=c(0,2))+
ylab(" ") +
xlab("Body weight (kg)")+
annotate("text", x = 1.6, y =0.95, label = "B", size = 8, hjust = -0.5)
#Combine grooming plots
plot <- ggarrange(age_plot, weight_plot, cond_plot, nrow = 1, ncol = 3)
plot <- annotate_figure(plot, bottom = text_grob("Study site", size = 20))
print(plot)
ggsave(filename = "morpho plots.jpeg", plot, width=350, height= 150, units = "mm")
```
#Environmental vars influence GLM analysis
```{r}
mod <- glm(food_d ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data1)
mod <- glm(food_o ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data1)
mod <- glm(grooming_d ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data1)
mod <- glm(grooming_o ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data1)
mod <- glm(jump_climb_d ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data1)
mod <- glm(jump_climb_o ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data1)
mod <- glm(legs_d ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data1)
mod <- glm(legs_o ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data1)
mod <- glm(moving_d ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data1)
mod <- glm(moving_o ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data1)
mod <- glm(perch_d ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data1)
mod <- glm(perch_o ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data1)
mod <- glm(bait_eaten_g ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data1)
mod <- glm(sumsect_o ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data1)
mod <- glm(totalact_o ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data1)
mod <- glm(emerge_max ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data1)
mod <- glm(stress_in_trap ~ temp + moon_phase, data=data1)
mod <- glm(stress_in_bag ~ temp + moon_phase, data=data1)
mod <- glm(stress_on_table ~ temp + moon_phase, data=data1)
summary(mod)
```
#Environmental vars tables with kabelExtra
```{r}
#Tables with kableExtra
response_var <- all.vars(formula(mod))[1]
tidy_results <- tidy(mod) %>%
mutate_if(is.numeric, ~round(., digits = 3))
table <- tidy_results %>%
mutate(p.value = ifelse(p.value <= 0.05, cell_spec(p.value, bold = TRUE), p.value)) %>%
kbl(caption = response_var, escape = FALSE) %>%
kable_classic(full_width = F, html_font = "Times New Roman") %>%
kable_styling(bootstrap_options = "striped", font_size = 12)
table
```
Analysis of behaviour indicators
1. Test the influence of fixed (e.g., site) and random effects (e.g., arena) on behavioural responses (e.g., food interaction duration) using the `lmer()` function.
2. If multiple fixed effects produce significance, perform model selection using the dredge() function to determine which fixed effects are within delta 2 AICc.
#Capture behaviour GLMMS
Testing behaviour in GLMMs including environmental variables as competing factors in fixed effects model.
```{r}
mod <- lmer(bait_eaten_g ~ study_site + sex + age_n + cond_n + body_weight_kg + (1|arena),
data=data1, na.action = "na.fail")
mod <- lmer(emerge_max ~ study_site + sex + age_n + cond_n + body_weight_kg + temp + (1|arena),
data=data1, na.action = "na.fail")
mod <- lmer(food_d ~ study_site + sex + age_n + cond_n + body_weight_kg + (1|arena),
data=data1, na.action = "na.fail")
mod <- lmer(food_o ~ study_site + sex + age_n + cond_n + body_weight_kg + (1|arena),
data=data1, na.action = "na.fail")
mod <- lmer(grooming_d ~ study_site + sex + age_n + cond_n + body_weight_kg + temp + (1|arena),
data=data1, na.action = "na.fail")
mod <- lmer(grooming_o ~ study_site + sex + age_n + cond_n + body_weight_kg + temp + (1|arena),
data=data1, na.action = "na.fail")
mod <- lmer(jump_climb_d ~ study_site + sex + age_n + cond_n + body_weight_kg + (1|arena),
data=data1, na.action = "na.fail")
mod <- lmer(jump_climb_o ~ study_site + sex + age_n + cond_n + body_weight_kg + (1|arena),
data=data1, na.action = "na.fail")
mod <- lmer(legs_d ~ study_site + sex + age_n + cond_n + body_weight_kg + (1|arena),
data=data1, na.action = "na.fail")
mod <- lmer(legs_o ~ study_site + sex + age_n + cond_n + body_weight_kg + (1|arena),
data=data1, na.action = "na.fail")
mod <- lmer(moving_d ~ study_site + sex + age_n + cond_n + body_weight_kg + time_assaytolight + (1|arena),
data=data1, na.action = "na.fail")
mod <- lmer(moving_o ~ study_site + sex + age_n + cond_n + body_weight_kg + time_assaytolight + (1|arena),
data=data1, na.action = "na.fail")
mod <- lmer(perch_d ~ study_site + sex + age_n + cond_n + body_weight_kg + temp + moon_phase +
time_assaytolight + time_processtoassay + (1|arena),
data=data1, na.action = "na.fail")
mod <- lmer(perch_o ~ study_site + sex + age_n + cond_n + body_weight_kg + (1|arena),
data=data1, na.action = "na.fail")
mod <- lmer(stress_in_bag ~ study_site + sex + age_n + cond_n + body_weight_kg + (1|arena),
data=data1, na.action = "na.fail")
mod <- lmer(stress_in_trap ~ study_site + sex + age_n + cond_n + body_weight_kg + (1|arena),
data=data1, na.action = "na.fail")
mod <- lmer(stress_on_table ~ study_site + sex + age_n + cond_n + body_weight_kg + (1|arena),
data=data1, na.action = "na.fail")
mod <- lmer(sumsect_o ~ study_site + sex + age_n + cond_n + body_weight_kg + (1|arena),
data=data1, na.action = "na.fail")
mod <- lmer(totalact_o ~ study_site + sex + age_n + cond_n + body_weight_kg + (1|arena),
data=data1, na.action = "na.fail")
```
```{r}
#Tables with kableExtra
response_var <- all.vars(formula(mod))[1]
tidy_results <- tidy(mod) %>%
mutate_if(is.numeric, ~round(., digits = 3))
table <- tidy_results %>%
mutate(p.value = ifelse(p.value <= 0.05, cell_spec(p.value, bold = TRUE), p.value)) %>%
kbl(caption = response_var, escape = FALSE)
table
```
#Capture behaviour AICc model selection
```{r}
control_ml <- lmerControl(optimizer = "Nelder_Mead")
#Grooming duration
mod_gd_site <- lmer(grooming_d ~ study_site + (1|arena),
data=data1, control = control_ml, na.action = "na.fail")
mod_gd_temp <- lmer(grooming_d ~ temp + (1|arena),
data=data1, control = control_ml, na.action = "na.fail")
models <- list(mod_gd_site, mod_gd_temp)
model.names <- c("Site", "Temp")
aictab(cand.set = models, modnames = model.names)
#Grooming occurrences
mod_go_site <- lmer(grooming_o ~ study_site + (1|arena),
data=data1, control = control_ml, na.action = "na.fail")
mod_go_temp <- lmer(grooming_o ~ temp + (1|arena),
data=data1, control = control_ml, na.action = "na.fail")
models <- list(mod_go_site, mod_go_temp)
model.names <- c("Site", "Temp")
aictab(cand.set = models, modnames = model.names)
#Latency to emerge
mod_emerge_temp <- lmer(emerge_max ~ temp + (1|arena),
data=data1, control = control_ml, na.action = "na.fail")
mod_emerge_weight <- lmer(emerge_max ~ body_weight_kg + (1|arena),
data=data1, control = control_ml, na.action = "na.fail")
mod_emerge_age <- lmer(emerge_max ~ age_n + (1|arena),
data=data1, control = control_ml, na.action = "na.fail")
models <- list(mod_emerge_temp, mod_emerge_weight, mod_emerge_age)
model.names <- c("Temp", "Weight", "Age")
aictab(cand.set = models, modnames = model.names)
```
#Capture behaviour plots
```{r}
#Grooming duration v study site plot
groomd_site <- ggplot(data=data1, aes(x = study_site, y = grooming_d, fill=study_site)) +
geom_violin() +
geom_boxplot(col="grey20", fill="grey20", width=0.02, lwd=0.5) +
stat_summary(fun="median", geom="point", col="black", fill="white",
shape=21, size=3, stroke=1) +
scale_fill_manual (values = c("#7E67A0","#68C6A5")) +
theme_minimal() +
theme(legend.position = "none",
panel.grid = element_blank(),
axis.line.x = element_line(color = "black"),
axis.line.y = element_line(color = "black"),
text = element_text(size=18),
axis.text.x = element_text(size=18)) +
scale_y_continuous(breaks=seq(0,110,20),labels=seq(0,110,20), limits=c(0,110)) +
xlab("") + ylab("Grooming duration (s)") + labs("") +
annotate("text", x = "Mulligans Flat", y =110, label = "A", size = 9, hjust = -2)
print(groomd_site)
ggsave(filename = "1st assay - study site v grooming dur.jpeg", groomd_site, width=150, height= 150, units = "mm")
#Grooming occurrences v study site plot
groomo_site <- ggplot(data=data1, aes(x = study_site, y = grooming_o,
fill = study_site)) +
geom_violin() +
geom_boxplot(col="grey20", fill="grey20", width=0.02, lwd=0.5) +
stat_summary(fun="median", geom="point", col="black", fill="white",
shape=21, size=3, stroke=1) +
scale_fill_manual (values = c("#7E67A0","#68C6A5")) +
theme_minimal() +
theme(legend.position = "none",
panel.grid = element_blank(),
axis.line.x = element_line(color = "black"),
axis.line.y = element_line(color = "black"),
text = element_text(size=18),
axis.text.x = element_text(size=18)) +
scale_y_continuous(breaks=seq(0,8,2),labels=seq(0,8,2), limits=c(0,8)) +
xlab("") + ylab(expression(paste("Grooming occurrences ", italic(" (n)")))) + labs("") +
annotate("text", x = "Mulligans Flat", y =8, label = "B", size = 9, hjust = -2)
print(groomo_site)
ggsave(filename = "1st assay - study site v grooming occ.jpeg", groomo_site, width=150, height= 150, units = "mm")
#Moving duration v study site plot
moved_site <- ggplot(data=data1, aes(x = study_site, y = moving_d, fill=study_site)) +
geom_violin() +
geom_boxplot(col="grey20", fill="grey20", width=0.02, lwd=0.5) +
stat_summary(fun="median", geom="point", col="black", fill="white",
shape=21, size=3, stroke=1) +
scale_fill_manual (values = c("#7E67A0","#68C6A5")) +
theme_minimal() +
theme(legend.position = "none",
panel.grid = element_blank(),
axis.line.x = element_line(color = "black"),
axis.line.y = element_line(color = "black"),
text = element_text(size=18),
axis.text.x = element_text(size=18)) +
scale_y_continuous(breaks=seq(0,300,50),labels=seq(0,300,50), limits=c(0,300)) +
xlab("") + ylab("Quadrupedal movement \nduration (s)") + labs("") +
annotate("text", x = "Mulligans Flat", y =300, label = "C", size = 9, hjust = -2)
print(moved_site)
#ggsave(filename = "1st assay - study site v moving dur.jpeg", moved_site, width=100, height= 150, units = "mm")
#Combine grooming plots
plot <- ggarrange(groomd_site, groomo_site, moved_site, ncol = 3, nrow=1)
plot <- annotate_figure(plot,
#left = text_grob("Adjusted behaviours over two assays", rot=90, size = 16, face = "bold"),
bottom = text_grob("Study site", size = 20))
print(plot)
ggsave(filename = "1st assay - groom and move violin plots.jpeg", plot, width=350, height= 150, units = "mm")
#Perching vs temp
perchtemp <- ggplot(data=data1, aes(x = temp, y = perch_d)) +
geom_point() +
geom_smooth(method = "lm", se = TRUE, colour = "#1caa85", fill = "#68C6AE") +
theme_minimal() +
theme(legend.position = "right",
panel.grid = element_blank(),
axis.line.x = element_line(color = "black"),
axis.line.y = element_line(color = "black"),
text = element_text(size=20)) +
scale_y_continuous(breaks=seq(0,1000,250),labels=seq(0,1000,250), limits=c(-30, 1000)) +
xlab(expression(paste("Ambient temperature (", degree, "C)"))) +
ylab("Perching duration (s)") + labs("") +
annotate("text", x =23, y =990, label = "A", size = 10, hjust = 0)
print(perchtemp)
ggsave(filename = "1st assay perch temp.jpeg", perchtemp, width=150, height= 150, units = "mm")
#Latency to emerge vs temp
emergetemp <- ggplot(data=data1, aes(x = temp, y = emerge_max)) +
geom_point() +
geom_smooth(method = "lm", se = TRUE, colour = "#482677", fill = "#674A8E") +
theme_minimal() +
theme(legend.position = "right",
panel.grid = element_blank(),
axis.line.x = element_line(color = "black"),
axis.line.y = element_line(color = "black"),
text = element_text(size=20)) +
scale_x_continuous(breaks=seq(10,25,5),labels=seq(10,25,5), limits=c(10,25)) +
xlab(expression(paste("Ambient temperature (", degree, "C)"))) +
ylab("Latency to emerge (s)") + labs("") +
annotate("text", x =23, y =59, label = "B", size = 10, hjust = -1)
print(emergetemp)
ggsave(filename = "1st assay emerge temp.jpeg", emergetemp, width=150, height= 150, units = "mm")
#Emerge weight
emergeweight <- ggplot(data=data1, aes(x = body_weight_kg, y = emerge_max)) +
geom_point() +
geom_smooth(method = "lm", se = TRUE, colour = "#2D718E", fill = "#5089A1") +
theme_minimal() +
theme(legend.position = "right",
panel.grid = element_blank(),
axis.line.x = element_line(color = "black"),
axis.line.y = element_line(color = "black"),
text = element_text(size=20)) +
scale_x_continuous(breaks=seq(0.25,1.75,0.5),labels=seq(0.25,1.75,0.5), limits=c(0.25,1.75)) +
xlab("Body weight (kg)") +
ylab("Latency to emerge (s)") +
labs("") +
annotate("text", x =1.6, y =59, label = "C", size = 10, hjust = 0)
print(emergeweight)
ggsave(filename = "1st assay emerge weight.jpeg", emergeweight, width=150, height= 150, units = "mm")
#Combine emerge plots
plot <- ggarrange(perchtemp, emergetemp, emergeweight, ncol = 3, nrow=1)
plot <- annotate_figure(plot,
bottom = text_grob("Study site", size = 20))
print(plot)
ggsave(filename = "1st assay emerge plots.jpeg", plot, width=350, height= 150, units = "mm")
```
## ** MULTIPLE ASSAYS
I created a data subset to test the behavioural variables over multiple assays for 17 individual eastern quolls.
#Subsetting data to animals with repeated assays
```{r}
values_to_exclude <- c("524E3", "53221", "53511", "53512", "53515", "53526", "563A6", "56ABE", "56EB2", "5FC08", "6D409" , "6D53F" , "6E990" , "71A4D" , "71B69" , "86E19" , "86FFC" , "87F61", "BCA09")
data2 <- data %>%
filter(!quoll_code %in% values_to_exclude)
write.csv(data2, "data2 - individuals with two assays raw data.csv")
```
#Capture and recapture environmental vars GLM analysis
```{r}
mod <- glm(bait_eaten_g ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data2)
mod <- glm(food_d ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data2)
mod <- glm(food_o ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data2)
mod <- glm(grooming_d ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data2)
mod <- glm(grooming_o ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data2)
mod <- glm(jump_climb_d ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data2)
mod <- glm(jump_climb_o ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data2)
mod <- glm(legs_d ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data2)
mod <- glm(legs_o ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data2)
mod <- glm(moving_d ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data2)
mod <- glm(moving_o ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data2)
mod <- glm(perch_d ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data2)
mod <- glm(perch_o ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data2)
mod <- glm(emerge_max ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data2)
mod <- glm(sumsect_o ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data2)
mod <- glm(totalact_o ~ temp + moon_phase + time_assaytolight + time_processtoassay, data=data2)
mod <- glm(stress_in_trap ~ temp + moon_phase, data=data2)
mod <- glm(stress_in_bag ~ temp + moon_phase, data=data2)
mod <- glm(stress_on_table ~ temp + moon_phase, data=data2)
```
#Capture and recapture environmental vars tables with kableExtra
```{r}
response_var <- all.vars(formula(mod))[1]
tidy_results <- tidy(mod) %>%
mutate_if(is.numeric, ~round(., digits = 3))
table <- tidy_results %>%
mutate(p.value = ifelse(p.value <= 0.05, cell_spec(p.value, bold = TRUE), p.value)) %>%
kbl(caption = response_var, escape = FALSE)
table
```
#Capture and recapture behaviour GLMMs with environmental vars
```{r}
data2 <- data2 %>%
mutate(age_n = as.numeric(as.character(age_n)))
mod <- lmer(bait_eaten_g ~ study_site + sex + age_n + cond_n + body_weight_kg + moon_phase + (1|arena),
data=data2, na.action = "na.fail")
mod <- lmer(emerge_max ~ study_site + sex + age_n + cond_n + body_weight_kg + temp + (1|arena),
data=data2, na.action = "na.fail")
mod <- lmer(food_d ~ study_site + sex + age_n + cond_n + body_weight_kg + moon_phase +(1|arena),
data=data2, na.action = "na.fail")
mod <- lmer(food_o ~ study_site + sex + age_n + cond_n + body_weight_kg + time_assaytolight +
time_processtoassay + (1|arena), data=data2, na.action = "na.fail")
mod <- lmer(grooming_d ~ study_site + sex + age_n + cond_n + body_weight_kg + (1|arena),
data=data2, na.action = "na.fail")
mod <- lmer(grooming_o ~ study_site + sex + age_n + cond_n + body_weight_kg + (1|arena),
data=data2, na.action = "na.fail")
mod <- lmer(jump_climb_d ~ study_site + sex + age_n + cond_n + body_weight_kg + time_assaytolight+ (1|arena),
data=data2, na.action = "na.fail")
mod <- lmer(jump_climb_o ~ study_site + sex + age_n + cond_n + body_weight_kg + (1|arena),
data=data2, na.action = "na.fail")
mod <- lmer(legs_d ~ study_site + sex + age_n + cond_n + body_weight_kg + moon_phase + (1|arena),
data=data2, na.action = "na.fail")
mod <- lmer(legs_o ~ study_site + sex + age_n + cond_n + body_weight_kg + time_assaytolight +
time_processtoassay + (1|arena),
data=data2, na.action = "na.fail")
mod <- lmer(moving_d ~ study_site + sex + age_n + cond_n + body_weight_kg + moon_phase +
time_assaytolight + time_processtoassay + (1|arena),
data=data2, na.action = "na.fail")
mod <- lmer(moving_o ~ study_site + sex + age_n + cond_n + body_weight_kg + moon_phase +
time_assaytolight + time_processtoassay + (1|arena),
data=data2, na.action = "na.fail")
mod <- lmer(perch_d ~ study_site + sex + age_n + cond_n + body_weight_kg + (1|arena),
data=data2, na.action = "na.fail")
mod <- lmer(perch_o ~ study_site + sex + age_n + cond_n + body_weight_kg + (1|arena),
data=data2, na.action = "na.fail")
mod <- lmer(stress_in_bag ~ study_site + sex + age_n + cond_n + body_weight_kg + (1|arena),
data=data2, na.action = "na.fail")
mod <- lmer(stress_in_trap ~ study_site + sex + age_n + cond_n + body_weight_kg + (1|arena),
data=data2, na.action = "na.fail")
mod <- lmer(stress_on_table ~ study_site + sex + age_n + cond_n + body_weight_kg +
(1|arena),
data=data2, na.action = "na.fail")
mod <- lmer(sumsect_o ~ study_site + sex + age_n + cond_n + body_weight_kg + moon_phase +
time_processtoassay + (1|arena),
data=data2, na.action = "na.fail")
mod <- lmer(totalact_o ~ study_site + sex + age_n + cond_n + body_weight_kg + moon_phase +
time_processtoassay + time_assaytolight + (1|arena),
data=data2, na.action = "na.fail")
```
```{r}
#Tables with kableExtra
response_var <- all.vars(formula(mod))[1]
tidy_results <- tidy(mod) %>%
mutate_if(is.numeric, ~round(., digits = 3))
table <- tidy_results %>%
mutate(p.value = ifelse(p.value <= 0.05, cell_spec(p.value, bold = TRUE), p.value)) %>%
kbl(caption = response_var, escape = FALSE)
table
```
#Capture and recapture behaviour AICc model selection
```{r}
control_ml <- lmerControl(optimizer = "Nelder_Mead")
#Food occ
mod_fo_process <- lmer(food_o ~ time_processtoassay + (1|arena),
data=data2, control = control_ml, na.action = "na.fail")
mod_fo_light <- lmer(food_o ~ time_assaytolight + (1|arena),
data=data2, control = control_ml, na.action = "na.fail")
models <- list(mod_fo_process, mod_fo_light)
model.names <- c("Process to assay", "Assay to light")
aictab(cand.set = models, modnames = model.names)
#Legs occ
mod_lo_process <- lmer(legs_o ~ time_processtoassay + (1|arena),
data=data2, control = control_ml, na.action = "na.fail")
mod_lo_light <- lmer(legs_o ~ time_assaytolight + (1|arena),
data=data2, control = control_ml, na.action = "na.fail")
models <- list(mod_lo_process, mod_lo_light)
model.names <- c("Process to assay", "Assay to light")
aictab(cand.set = models, modnames = model.names)
#Move occ
mod_mo_process <- lmer(moving_o ~ time_processtoassay + (1|arena),
data=data2, control = control_ml, na.action = "na.fail")
mod_mo_light <- lmer(moving_o ~ time_assaytolight + (1|arena),
data=data2, control = control_ml, na.action = "na.fail")
models <- list(mod_mo_process, mod_mo_light)
model.names <- c("Process to assay", "Assay to light")
aictab(cand.set = models, modnames = model.names)
#Move dur
mod_md_process <- lmer(moving_d ~ time_processtoassay + (1|arena),
data=data2, control = control_ml, na.action = "na.fail")
mod_md_light <- lmer(moving_d ~ time_assaytolight + (1|arena),
data=data2, control = control_ml, na.action = "na.fail")
models <- list(mod_md_process, mod_md_light)
model.names <- c("Process to assay", "Assay to light")
aictab(cand.set = models, modnames = model.names)
#Table stress
mod_table_process <- lmer(stress_on_table ~ time_processtoassay + (1|arena),
data=data2, control = control_ml, na.action = "na.fail")
mod_table_light <- lmer(stress_on_table ~ time_assaytolight + (1|arena),
data=data2, control = control_ml, na.action = "na.fail")
models <- list(mod_table_process, mod_table_light)
model.names <- c("Process to assay", "Assay to light")
aictab(cand.set = models, modnames = model.names)
```
#Plots for two assays
```{r}
#Grooming duration v sex
groomdur <- ggplot(data=data2, aes(x = sex, y = grooming_d, fill = sex)) +
geom_boxplot() +
geom_boxplot(col="grey20", fill="grey20", width=0.02, lwd=0.5) +
stat_summary(fun="median", geom="point", col="black", fill="black",
shape=21, size=1.5, stroke=1) +
scale_fill_manual (values = c("#7E67A0","#4DBC94")) +
theme_minimal() +
theme(legend.position = "none",
panel.grid = element_blank(),
axis.line.x = element_line(color = "black"),
axis.line.y = element_line(color = "black"),
text = element_text(size=20)) +
scale_y_continuous(breaks=seq(0,80,20),labels=seq(0,80,20), limits=c(0,80)) +
xlab("Sex") +
ylab("Grooming duration (s)") + labs("") +
scale_x_discrete(labels = c("M" = "Male", "F" = "Female"))+
annotate("text", x="M", y =80, label = "C", size = 10, hjust = -2)
print(groomdur)
ggsave(filename = "2 assays - sex v grooming.jpeg", groomdur, width=150, height= 150, units = "mm")
#Bait eaten v age
baitage <- ggplot(data=data2, aes(x = age_estimate, y = bait_eaten_g, fill = age_estimate)) +
geom_violin() +
geom_boxplot(col="grey20", fill="grey20", width=0.02, lwd=0.5) +
stat_summary(fun="median", geom="point", col="black", fill="black",
shape=21, size=1.5, stroke=1) +
scale_fill_manual (values = c("#7E67A0","#68C6A5","#D0E970")) +
theme_minimal() +
theme(legend.position = "none",
panel.grid = element_blank(),
axis.line.x = element_line(color = "black"),
axis.line.y = element_line(color = "black"),
text = element_text(size=19)) +
scale_y_continuous(breaks=seq(0,50,25),labels=seq(0,50,25), limits=c(0,50)) +
xlab("Age estimate") +
ylab("Bait eaten (g)") + labs("") +
scale_x_discrete(labels = c("<1yr" = "<1 year", "1-2yrs" = "1-2 years", "2-3yrs" ="2-3 years"))+
annotate("text", x =2, y =50, label = "A", size = 10, hjust = -6)
print(baitage)
#Perhing v site
perchocc <- ggplot(data=data2, aes(x = study_site, y = perch_o, fill = study_site)) +
geom_violin() +
geom_boxplot(col="grey20", fill="grey20", width=0.02, lwd=0.5) +
stat_summary(fun="median", geom="point", col="black", fill="black",
shape=21, size=1.5, stroke=1) +
scale_fill_manual (values = c("#7E67A0","#68C6A5")) +
theme_minimal() +
theme(legend.position = "none",
panel.grid = element_blank(),
axis.line.x = element_line(color = "black"),
axis.line.y = element_line(color = "black"),
text = element_text(size=19)) +
scale_y_continuous(breaks=seq(0,60,20),labels=seq(0,60,20), limits=c(0,60)) +
xlab("Study site") +
ylab(expression(paste("Perching occurrences ", italic(" (n)")))) +
annotate("text", x ="Mulligans Flat", y =60, label = "B", size = 10, hjust = -2)
print(perchocc)
ggsave(filename = "2 assays raw - site v perching.jpeg", perchocc, width=150, height= 150, units = "mm")
#Combine plots
plot <- ggarrange(baitage, perchocc, groomdur, ncol = 3, nrow=1)
print(plot)
ggsave(filename = "2 assays -bait perch emerge.jpeg", plot, width=350, height= 150, units = "mm")
#Total section vs moon
sum_moon <- ggplot(data=data2, aes(x = moon_phase, y = sumsect_o)) +
geom_point() +
geom_smooth(method = "lm", se = TRUE, colour = "#440154", fill = "#82568D") +
theme_minimal() +
theme(legend.position = "right",
panel.grid = element_blank(),
axis.line.x = element_line(color = "black"),
axis.line.y = element_line(color = "black"),
text = element_text(size=18)) +
scale_y_continuous(breaks=seq(0,100,25),labels=seq(0,100,25), limits=c(0,100)) +
xlab("Moon illumination (%)") +
ylab(expression(paste("Sum of arena section visits", italic(" (n)")))) + labs("") +
annotate("text", x =100, y =100, label = "A", size = 10, hjust = 1)
print(sum_moon)
ggsave(filename = "2 assay raw - emerge temp.jpeg", emergetemp, width=150, height= 150, units = "mm")
#Food occ v time assay to light
foodo_light <- ggplot(data=data2, aes(x = time_assaytolight, y = food_o)) +
geom_point() +
geom_smooth(method = "lm", se = TRUE, colour = "#472D7B", fill = "#8473A7") +
theme_minimal() +
theme(legend.position = "right",
panel.grid = element_blank(),
axis.line.x = element_line(color = "black"),
axis.line.y = element_line(color = "black"),
text = element_text(size=18)) +
scale_y_continuous(breaks=seq(0,50,10),labels=seq(0,50,10), limits=c(-5,55)) +
xlab("Time: assay to first light (mins)") +
ylab(expression(paste("Food interaction occurrences ", italic(" (n)")))) + labs("") +
annotate("text", x =400, y =55, label = "B", size = 10, hjust = 1)
print(foodo_light)
ggsave(filename = "2 assay raw - food light.jpeg", foodo_light, width=150, height= 150, units = "mm")
#Food occ v time process to assay
foodo_process <- ggplot(data=data2, aes(x = time_processtoassay, y = food_o)) +
geom_point() +
geom_smooth(method = "lm", se = TRUE, colour = "#3B528B", fill = "#7C8CB2") +
theme_minimal() +
theme(legend.position = "right",
panel.grid = element_blank(),
axis.line.x = element_line(color = "black"),
axis.line.y = element_line(color = "black"),
text = element_text(size=18)) +
scale_y_continuous(breaks=seq(0,50,10),labels=seq(0,50,10), limits=c(-10,55)) +
scale_x_continuous(breaks=seq(50,250,50),labels=seq(50,250,50), limits=c(40,250)) +
xlab("Time: processing to assay (mins)") +
ylab(expression(paste("Food interaction occurrences ", italic(" (n)")))) + labs("") +
annotate("text", x =250, y =55, label = "C", size = 10, hjust = 1)
print(foodo_process)
ggsave(filename = "2 assay raw - food process.jpeg", foodo_process, width=150, height= 150, units = "mm")
#Move dur v time assay to light
moved_light <- ggplot(data=data2, aes(x = time_assaytolight, y = moving_d)) +
geom_point() +
geom_smooth(method = "lm", se = TRUE, colour = "#2C728E", fill = "#72A1B4") +
theme_minimal() +
theme(legend.position = "right",
panel.grid = element_blank(),
axis.line.x = element_line(color = "black"),
axis.line.y = element_line(color = "black"),
text = element_text(size=18)) +
scale_y_continuous(breaks=seq(0,250,50),labels=seq(0,250,50), limits=c(0,250)) +
xlab("Time: assay to first light (mins)") +
ylab("Quadrupedal movement duration (s)") + labs("") +
annotate("text", x =400, y =245, label = "D", size = 10, hjust = 1)
print(moved_light)
ggsave(filename = "2 assay raw - legs light.jpeg", legso_light, width=150, height= 150, units = "mm")
#Move occ v time assay to light
moveo_light <- ggplot(data=data2, aes(x = time_assaytolight, y = moving_o)) +
geom_point() +
geom_smooth(method = "lm", se = TRUE, colour = "#21908C", fill = "#6BB5B2") +
theme_minimal() +
theme(legend.position = "right",
panel.grid = element_blank(),
axis.line.x = element_line(color = "black"),
axis.line.y = element_line(color = "black"),
text = element_text(size=18)) +
scale_y_continuous(breaks=seq(0,200,50),labels=seq(0,200,50), limits=c(0,200)) +
xlab("Time: assay to first light (mins)") +
ylab(expression(paste("Quadrupedal movement occurrences ", italic(" (n)")))) + labs("") +
annotate("text", x =395, y =195, label = "E", size = 10, hjust = 1)
print(moveo_light)
ggsave(filename = "2 assay raw - legs light.jpeg", legso_light, width=150, height= 150, units = "mm")
#Move occ v time process to assay
moveo_process <- ggplot(data=data2, aes(x = time_processtoassay, y = moving_o)) +
geom_point() +
geom_smooth(method = "lm", se = TRUE, colour = "#27AD81", fill = "#6FC8AB") +
theme_minimal() +
theme(legend.position = "right",
panel.grid = element_blank(),
axis.line.x = element_line(color = "black"),
axis.line.y = element_line(color = "black"),
text = element_text(size=18)) +
scale_x_continuous(breaks=seq(50,300,50),labels=seq(50,300,50), limits=c(50,300)) +
xlab("Time: processing to assay (mins)") +
ylab(expression(paste("Quadrupedal movement occurrences ", italic(" (n)")))) + labs("") +
annotate("text", x =300, y =195, label = "F", size = 10, hjust = 1)
print(moveo_process)
ggsave(filename = "2 assay raw - legs process.jpeg", legso_process, width=150, height= 150, units = "mm")
#Legs occ v time assay to light
legso_light <- ggplot(data=data2, aes(x = time_assaytolight, y = legs_o)) +
geom_point() +
geom_smooth(method = "lm", se = TRUE, colour = "#5DC863", fill = "#93DA97") +
theme_minimal() +
theme(legend.position = "right",
panel.grid = element_blank(),
axis.line.x = element_line(color = "black"),
axis.line.y = element_line(color = "black"),
text = element_text(size=18)) +
scale_y_continuous(breaks=seq(0,150,50),labels=seq(0,150,50), limits=c(0,150)) +
xlab("Time: assay to first light (mins)") +
ylab(expression(paste("Hind leg stand occurrences", italic(" (n)")))) + labs("") +
annotate("text", x =400, y =150, label = "G", size = 10, hjust = 1)
print(legso_light)
ggsave(filename = "2 assay raw - legs light.jpeg", legso_light, width=150, height= 150, units = "mm")
#Legs occ v time process to assay
legso_process <- ggplot(data=data2, aes(x = time_processtoassay, y = legs_o)) +
geom_point() +
geom_smooth(method = "lm", se = TRUE, colour = "#AADC32", fill = "#C6E876") +
theme_minimal() +
theme(legend.position = "right",
panel.grid = element_blank(),