Bringing it All Together

Some examples of using all my tools from EDS 221 to wrangle and create data visualizations.

Jake Eisaguirre true
08-20-2021
fids <- read_csv(here("_posts","2021-08-20-bringing-it-all-together", "HTL-MAR-FiddlerCrabBodySize_copy.csv"))

Data Exploration

ggplot(fids, aes(x = Latitude, y = carapace_width)) + 
  geom_point(aes(color = Latitude)) +
  labs(title = "Carapace Width by Latitude",
       x = "Latitude", 
       y = "Carapace Width (mm)", 
       caption = "Figure A is the observed Caprapace widths at latitude degrees") +
  theme_classic()

Here we have a nice figure in which we can do some initial data exploration regarding carapace width by latitude.

Data Table

data <- fids %>%
  clean_names() %>% 
  group_by(site) %>% 
  summarize(mean_carapace_width = round(mean(carapace_width), 2), sd_carapace_width = round(sd(carapace_width), 2), sample_size = n())

kable(data, col.name = c("Site", "Mean Carapace Width (mm)", "SD Carapace Width (mm)", "Sample Size")) %>% 
  kable_classic()
Site Mean Carapace Width (mm) SD Carapace Width (mm) Sample Size
BC 16.20 4.81 37
CC 16.82 2.05 27
CT 14.69 2.36 33
DB 15.60 2.12 30
GTM 12.40 1.80 28
JC 15.27 2.72 30
NB 17.14 2.29 29
NIB 13.29 2.42 30
PIE 18.50 2.30 28
RC 12.49 2.34 25
SI 9.85 1.79 30
VCR 16.34 2.94 30
ZI 12.06 2.01 35

Here is a data table with some basic info about our fiddler crabs at different sites

Temperature vs Carapace Width

mean_data = fids %>% 
  clean_names() %>%
  group_by(matw) %>% 
  summarize(mean_carapace_width = mean(carapace_width))
  
ggplot(mean_data, aes(x = matw, y = mean_carapace_width)) + 
  geom_point() + 
  labs(title = "Mean Carapace Width by Temp", 
       x = "Mean Annual Water Temperature", 
       y = "Mean Carapace Width (mm)", 
       caption = "Figure B shows a negative trend in mean carapace width with increase in water temperature.") +
  theme_classic() +
  geom_smooth(method = "lm")

Scatterplot of mean annual temperature compared to mean carapace width. Increases in temeperature result in decreases in mean width size.

Here we can see the possible correlation between mean carapace width and temperature

Citations

```{.r .distill-force-highlighting-css}