---
title: "Lab 05 - Data Summary"
author: "WILD 502 - Jay Rotella"
output: pdf_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## Bring in the Data

```{r, message = FALSE}
library(tidyverse)
library(GGally)
library(RMark)
sq <- convert.inp("http://www.montana.edu/rotella/documents/502/SwampSquirrels.inp", 
                  group.df = data.frame(age = c("juv","older")),
                  covariates = c("birth", "tail"))
head(sq, 4)

# select just the covariates that will be used in modeling
sq.covs <- sq %>% 
  select(birth, tail, age)
head(sq.covs, 4)
```

## Some useful Summary Statistics

Here, we have 2 continuous covariates and 1 categorical. 
```{r, message = FALSE}
summary(sq.covs)
# get SDs for continuous covariates
apply(sq.covs[, 1:2], 2, sd) 

ggpairs(sq.covs, aes(color = age, alpha = 0.2))
```

```{r, message = FALSE, fig.width=3, fig.height=3}
ggplot(sq.covs, aes(x = age, y = birth)) +
  geom_boxplot() + 
  geom_point(pch = 21, position = position_jitter())

ggplot(sq.covs, aes(x = age, y = tail)) +
  geom_boxplot() + 
  geom_point(pch = 21, position = position_jitter())
```

