-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfinal-report.Rmd
More file actions
125 lines (85 loc) · 4.3 KB
/
final-report.Rmd
File metadata and controls
125 lines (85 loc) · 4.3 KB
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
---
title: "Final Report of Our Ecology Survey"
author: Donna Wrublewski, Thomas Morrell, Gail Clement, `r params$institution`
date: "`r format(Sys.Date(), '%A, %B %d, %Y')`"
output:
html_document:
code_folding: hide
highlight: kate
number_sections: yes
theme: journal
toc: yes
toc_depth: 2
toc_float: yes
params:
institution:
choices:
- Kentucky Fried Chicken, Inc.
- CODATA-RDA Summer School for Data Science
- Elsevier Inc
- California Institute of Technology
input: select
label: 'Institution:'
value: California Institute of Technology
bibliography: references.bib
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r include=FALSE}
source("load_packages.R")
library("tidyverse")
library("shiny")
library("DT")
```
-----
# Introduction
The data for this workshop are from the "Portal Project Teaching Database" available on FigShare at https://figshare.com/articles/Portal_Project_Teaching_Database/1314459 with a CC-BY license available for reuse. (@Ernest2018) The Portal Project Teaching Database is a simplified version of the Portal Project Database designed for teaching. It is a tabular dataset of observations of small mammals in a desert ecosystem in Arizona, USA, collected over more than 40 years. It provides a real world example of life-history, population, and ecological data, with sufficient complexity to teach many aspects of data analysis and management, but with many complexities removed to allow students to focus on the core ideas and skills being taught.
---
This study looks at Bailey's pocket mouse (Chaetodipus baileyi), a species of rodent in the subfamily Perognathinae, family Heteromyidae. It is found in Baja California, Sinaloa and Sonora in Mexico and in California, Arizona and New Mexico in the United States.
.
@unknown2018a
---
## Hypothesis
Baileys Pocket Mouse is a native species to the study area and thus well adpated to the environment over the period studied. It represents a stable population for which we should see little change over time.
---
# Methods
```{r data, include=FALSE}
#load the data
surveys_complete <- read_csv("data_output/surveys_complete.csv")
yearly_counts <- surveys_complete %>% count(year, species_id)
PB_data <- filter(yearly_counts, species_id=='PB')
```
## A Closer Look at Species Populations
1. This study used the data table `surveys.csv` from the Portals database. This table includes `r nrow(surveys_complete)` observations of the species _`r unique(surveys_complete$species)`_.
1. The downloaded csv file was imported into RStudio, analyzed, filtered, organized in a structured data table, and plotted as shown below.
1. The report was compiled in RStudio using RMarkdown, knitr, Pandoc, and a lot of luck!
---
```{r data-table}
yearly_counts %>%
datatable(rownames = FALSE,
colnames = c("year", "species_id", "n"),
class = "cell-border compact stripe",
caption = htmltools::tags$caption("Table 1 - Species Populations in Analyzed Dataset", style="color:orange"),
filter = list(position = "bottom"),
extensions = 'Buttons', options = list(dom = 'Bfrtip',
buttons = c('colvis', 'csv', 'pdf'))
)
```
# Results
We find that the population of Chaetodipus baileyi has dramatically increased during the study period. This may be due to a cheese factory moving into land adjacent to our sampling site in 1995 and ramping up production over the past two decades.
```{r plot}
ggplot(data = PB_data, mapping = aes(x=year, y=n)) + geom_line()
#Jazz up this plot with a Title, a label for the y axis, and #change the line color to something of your choice
```
# Appendices {-}
## Acknowledgements: Key Resources used in the making of this Report
* bibtex citations stored in references.bib file | convert cites to bibtex using <https://anystyle.io/>
* Bootswatch themes | applied in yaml <https://bootswatch.com>
* _RMarkdown: The Definitive Guide_ by Yihui Xie, J. J. Allaire, Garrett Grolemund | Free bookdown book at <https://bookdown.org/yihui/rmarkdown/>
---
## Session Information
```{r session-info}
sessionInfo()
```
# References