Site 1: Calico Basin




Site 2: Valley of Fire


table_transect_logistics <- gila_transect_data %>%
  select(
    site_id,
    detection,
    total_length_m,
    tran_time_min
  ) %>%
  tbl_summary(
    by = site_id,
    missing = "no",
    digits = all_continuous() ~ 1,
    statistic = list(all_continuous() ~ "{mean} ({sd})",
                     all_categorical() ~ "{n} ({p}%)"),
    label = list(
      detection ~ "Detections",
      tran_time_min ~ "Length of Time (min)",
      total_length_m ~ "Distance (m)")) %>%
  modify_caption("Table 1. Transect Logistics Data")

table_transect_logistics
Table 1. Transect Logistics Data
Characteristic Calico Basin
N = 138
1
Valley of Fire
N = 149
1
Detections 7 (5.1%) 15 (10%)
Distance (m) 1,000.6 (36.7) 1,008.4 (49.0)
Length of Time (min) 106.7 (14.6) 103.2 (11.9)
1 n (%); Mean (SD)
boxplot_distance <- ggplot(gila_transect_data, aes(x = site_id, y = total_length_m)) +
  geom_boxplot() +
  geom_point() +
  ylab ("Total Transect Length (m)") +
  xlab ("Site")

boxplot_time <- ggplot(gila_transect_data, aes(x = site_id, y = tran_time_min)) +
  geom_boxplot() +
  geom_point() +
  ylab ("Transect Time (min)") +
  xlab ("Site") +
  scale_y_continuous(limits = c(75, 150), breaks = c(75, 90, 105, 120, 135, 150))
  
(boxplot_distance + boxplot_time)

ttest_rock_cal <- t.test(data_transect_cal$rock_ind_avg, data_transect_cal$rock_ind_median, paired = TRUE)
ttest_rock_vof <- t.test(data_transect_vof$rock_ind_avg, data_transect_vof$rock_ind_median, paired = TRUE)

ttest_rock_cal
## 
##  Paired t-test
## 
## data:  data_transect_cal$rock_ind_avg and data_transect_cal$rock_ind_median
## t = 1.2914, df = 137, p-value = 0.1987
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
##  -0.02733214  0.13023069
## sample estimates:
## mean difference 
##      0.05144928
ttest_rock_vof
## 
##  Paired t-test
## 
## data:  data_transect_vof$rock_ind_avg and data_transect_vof$rock_ind_median
## t = -1.4703, df = 148, p-value = 0.1436
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
##  -0.22842676  0.03352743
## sample estimates:
## mean difference 
##     -0.09744966
table_transect_env <- gila_transect_data %>%
  select(
    site_id,
    elev,
    air_temp,
    gr_temp,
    avg_wind_spd,
    rock_ind_avg,
    shr_dens,
    vap_pres_kPa,
    prey_pres
  ) %>%
  tbl_summary(
    by = site_id,
    missing = "no",
    digits = all_continuous() ~ 1,
    statistic = list(all_continuous() ~ "{mean} ({sd})",
                     all_categorical() ~ "{n} ({p}%)"),
    label = list(
      elev ~ "Elevation (m)",
      air_temp ~ "Air Temperature (C)",
      gr_temp ~ "Ground Temperature (C)",
      avg_wind_spd ~ "Average Wind Speed (km/h)",
      rock_ind_avg ~ "Granularity Index",
      shr_dens ~ "Shrub Density (n/m^2)",
      vap_pres_kPa ~ "Vapor Pressure (kPa)",
      prey_pres ~ "Prey Presence (n)"
      )) %>%
  add_p(pvalue_fun = ~ style_pvalue(.x, digits = 2)) %>%
  modify_caption("Table 3. Transect Environmental Data")

table_transect_env
Table 3. Transect Environmental Data
Characteristic Calico Basin
N = 138
1
Valley of Fire
N = 149
1
p-value2
Elevation (m) 1,225.7 (84.9) 597.4 (35.9) <0.001
Air Temperature (C) 26.3 (5.0) 30.4 (4.2) <0.001
Ground Temperature (C) 28.9 (5.1) 33.1 (5.0) <0.001
Average Wind Speed (km/h) 4.5 (2.4) 3.8 (2.8) 0.036
Granularity Index 3.2 (0.7) 3.7 (1.0) <0.001
Shrub Density (n/m^2) 0.4 (0.2) 0.2 (0.1) <0.001
Vapor Pressure (kPa) 2.8 (1.0) 3.6 (1.1) <0.001
Prey Presence (n) 1.9 (2.6) 0.4 (1.1) <0.001
1 Mean (SD)
2 Welch Two Sample t-test
gathered_env_data <- gila_transect_data %>%
  select(
    site_id,
    elev,
    air_temp,
    gr_temp,
    avg_wind_spd,
    rock_ind_avg,
    shr_dens,
    vap_pres_kPa,
    prey_pres
  ) %>%
    gather(-site_id, key="var", value = "value")

ggplot(gathered_env_data, aes(x = site_id, y = value)) +
    geom_boxplot() +
    geom_point() +
    facet_wrap(~var, scales = "free") +
    theme_bw()

table_detections_cal <- gila_transect_data %>%
  filter(site_id == "Calico Basin") %>%
  select(
    detection,
    elev,
    air_temp,
    gr_temp,
    avg_wind_spd,
    rock_ind_avg,
    shr_dens,
    vap_pres_kPa,
    prey_pres
  ) %>%
  tbl_summary(
    by = detection,
    missing = "no",
    digits = all_continuous() ~ 1,
    statistic = list(all_continuous() ~ "{mean} ({sd})",
                     all_categorical() ~ "{n} ({p}%)"),
    label = list(
      elev ~ "Elevation (m)",
      air_temp ~ "Air Temperature (C)",
      gr_temp ~ "Ground Temperature (C)",
      avg_wind_spd ~ "Average Wind Speed (km/h)",
      rock_ind_avg ~ "Granularity Index",
      shr_dens ~ "Shrub Density (n/m^2)",
      vap_pres_kPa ~ "Vapor Pressure (kPa)",
      prey_pres ~ "Prey Presence (n)"
      )) %>%
  add_p(test = all_continuous() ~ "t.test",
        pvalue_fun = ~ style_pvalue(.x, digits = 2)) %>%
  modify_fmt_fun(statistic ~ style_sigfig) %>% 
  modify_caption("Table 4. Transect Detections Data for Calico Basin") %>%
  modify_header(
    update = list(
      label ~ '**Calico Basin**',
      stat_1 ~ '**Non-detection**<br>N = {n}',
      stat_2 ~ '**Detection**<br>N = {n}',
      statistic ~ "**t-value**",
      p.value ~ '**P-value**')) %>%
  modify_footnote(everything() ~ NA)
  

table_detections_cal
Table 4. Transect Detections Data for Calico Basin
Calico Basin Non-detection
N = 131
Detection
N = 7
t-value P-value
Elevation (m) 1,227.3 (86.4) 1,194.4 (41.2) 1.9 0.089
Air Temperature (C) 26.2 (5.1) 28.1 (4.5) -1.1 0.32
Ground Temperature (C) 28.8 (5.1) 30.4 (4.0) -1.0 0.34
Average Wind Speed (km/h) 4.6 (2.5) 3.4 (2.0) 1.5 0.18
Granularity Index 3.1 (0.7) 3.8 (0.6) -3.0 0.021
Shrub Density (n/m^2) 0.4 (0.2) 0.5 (0.2) -0.56 0.59
Vapor Pressure (kPa) 2.8 (1.0) 3.2 (0.8) -1.1 0.29
Prey Presence (n) 1.8 (2.3) 5.3 (4.7) -2.0 0.10
table_detections_cal_offtran <- gila_offtransect_data %>%
  filter(site_id == "Calico Basin") %>%
  select(
    detection,
    elev,
    air_temp,
    gr_temp,
    avg_wind_spd,
    rock_ind_avg,
    shr_dens,
    vap_pres_kPa,
    prey_pres
  ) %>%
  tbl_summary(
    by = detection,
    missing = "no",
    digits = all_continuous() ~ 1,
    statistic = list(all_continuous() ~ "{mean} ({sd})",
                     all_categorical() ~ "{n} ({p}%)"),
    label = list(
      elev ~ "Elevation (m)",
      air_temp ~ "Air Temperature (C)",
      gr_temp ~ "Ground Temperature (C)",
      avg_wind_spd ~ "Average Wind Speed (km/h)",
      rock_ind_avg ~ "Granularity Index",
      shr_dens ~ "Shrub Density (n/m^2)",
      vap_pres_kPa ~ "Vapor Pressure (kPa)",
      prey_pres ~ "Prey Presence (n)"
      )) %>%
  add_p(test = all_continuous() ~ "t.test",
        pvalue_fun = ~ style_pvalue(.x, digits = 2)) %>%
  modify_fmt_fun(statistic ~ style_sigfig) %>% 
  modify_caption("Table 4. Transect Detections Data for Calico Basin with off-transect data") %>%
  modify_header(
    update = list(
      label ~ '**Calico Basin**',
      stat_1 ~ '**Non-detection**<br>N = {n}',
      stat_2 ~ '**Detection**<br>N = {n}',
      statistic ~ "**t-value**",
      p.value ~ '**P-value**')) %>%
  modify_footnote(everything() ~ NA)
  

table_detections_cal_offtran
Table 4. Transect Detections Data for Calico Basin with off-transect data
Calico Basin Non-detection
N = 131
Detection
N = 19
t-value P-value
Elevation (m) 1,227.3 (86.4) 1,156.9 (42.5) 5.7 <0.001
Air Temperature (C) 26.2 (5.1) 27.7 (4.3) -1.4 0.18
Ground Temperature (C) 28.8 (5.1) 29.6 (4.1) -0.82 0.42
Average Wind Speed (km/h) 4.6 (2.5) 3.8 (2.0) 1.5 0.14
Granularity Index 3.1 (0.7) 4.2 (1.1) -4.2 <0.001
Shrub Density (n/m^2) 0.4 (0.2) 0.7 (0.7) -1.9 0.071
Vapor Pressure (kPa) 2.8 (1.0) 3.1 (0.9) -1.2 0.25
Prey Presence (n) 1.8 (2.3) 2.3 (3.7) -0.58 0.57
table_detections_vof <- gila_transect_data %>%
  filter(site_id == "Valley of Fire") %>%
  select(
    detection,
    elev,
    air_temp,
    gr_temp,
    avg_wind_spd,
    rock_ind_avg,
    shr_dens,
    vap_pres_kPa,
    prey_pres
  ) %>%
  tbl_summary(
    by = detection,
    missing = "no",
    digits = all_continuous() ~ 1,
    statistic = list(all_continuous() ~ "{mean} ({sd})",
                     all_categorical() ~ "{n} ({p}%)"),
    label = list(
      elev ~ "Elevation (m)",
      air_temp ~ "Air Temperature (C)",
      gr_temp ~ "Ground Temperature (C)",
      avg_wind_spd ~ "Average Wind Speed (km/h)",
      rock_ind_avg ~ "Granularity Index",
      shr_dens ~ "Shrub Density (n/m^2)",
      vap_pres_kPa ~ "Vapor Pressure (kPa)",
      prey_pres ~ "Prey Presence (n)"
      )) %>%
  add_p(test = all_continuous() ~ "t.test",
        pvalue_fun = ~ style_pvalue(.x, digits = 2)) %>%
  modify_fmt_fun(statistic ~ style_sigfig) %>% 
  modify_caption("Table 5. Transect Detections Data for Valley of Fire") %>%
  modify_header(
    update = list(
      label ~ '**Valley of Valley**',
      stat_1 ~ '**Non-detection**<br>N = {n}',
      stat_2 ~ '**Detection**<br>N = {n}',
      statistic ~ "**t-value**",
      p.value ~ '**P-value**')) %>%
  modify_footnote(everything() ~ NA)
  

table_detections_vof
Table 5. Transect Detections Data for Valley of Fire
Valley of Valley Non-detection
N = 134
Detection
N = 15
t-value P-value
Elevation (m) 598.8 (36.4) 585.5 (29.6) 1.6 0.12
Air Temperature (C) 30.3 (4.3) 31.9 (2.7) -2.1 0.047
Ground Temperature (C) 33.2 (5.0) 32.5 (4.2) 0.55 0.59
Average Wind Speed (km/h) 3.8 (2.7) 4.0 (3.2) -0.21 0.83
Granularity Index 3.6 (1.0) 4.4 (0.9) -3.0 0.008
Shrub Density (n/m^2) 0.2 (0.1) 0.2 (0.1) 0.56 0.58
Vapor Pressure (kPa) 3.6 (1.1) 3.9 (0.9) -1.2 0.23
Prey Presence (n)


>0.99
    0 99 (74%) 12 (80%)

    1 23 (17%) 2 (13%)

    2 7 (5.2%) 1 (6.7%)

    3 3 (2.2%) 0 (0%)

    4 1 (0.7%) 0 (0%)

    11 1 (0.7%) 0 (0%)

table_detections_vof_offtran <- gila_offtransect_data %>%
  filter(site_id == "Valley of Fire") %>%
  select(
    detection,
    elev,
    air_temp,
    gr_temp,
    avg_wind_spd,
    rock_ind_avg,
    shr_dens,
    vap_pres_kPa,
    prey_pres
  ) %>%
  tbl_summary(
    by = detection,
    missing = "no",
    digits = all_continuous() ~ 1,
    statistic = list(all_continuous() ~ "{mean} ({sd})",
                     all_categorical() ~ "{n} ({p}%)"),
    label = list(
      elev ~ "Elevation (m)",
      air_temp ~ "Air Temperature (C)",
      gr_temp ~ "Ground Temperature (C)",
      avg_wind_spd ~ "Average Wind Speed (km/h)",
      rock_ind_avg ~ "Granularity Index",
      shr_dens ~ "Shrub Density (n/m^2)",
      vap_pres_kPa ~ "Vapor Pressure (kPa)",
      prey_pres ~ "Prey Presence (n)"
      )) %>%
  add_p(test = all_continuous() ~ "t.test",
        pvalue_fun = ~ style_pvalue(.x, digits = 2)) %>%
  modify_fmt_fun(statistic ~ style_sigfig) %>% 
  modify_caption("Table 5. Transect Detections Data for Valley of Fire with off-transect data") %>%
  modify_header(
    update = list(
      label ~ '**Valley of Valley**',
      stat_1 ~ '**Non-detection**<br>N = {n}',
      stat_2 ~ '**Detection**<br>N = {n}',
      statistic ~ "**t-value**",
      p.value ~ '**P-value**')) %>%
  modify_footnote(everything() ~ NA)
  

table_detections_vof_offtran
Table 5. Transect Detections Data for Valley of Fire with off-transect data
Valley of Valley Non-detection
N = 134
Detection
N = 21
t-value P-value
Elevation (m) 598.8 (36.4) 589.2 (30.6) 1.3 0.21
Air Temperature (C) 30.3 (4.3) 31.5 (3.0) -1.7 0.10
Ground Temperature (C) 33.2 (5.0) 32.1 (4.0) 1.1 0.27
Average Wind Speed (km/h) 3.8 (2.7) 4.1 (2.9) -0.39 0.70
Granularity Index 3.6 (1.0) 4.3 (1.5) -2.2 0.037
Shrub Density (n/m^2) 0.2 (0.1) 0.2 (0.2) 0.99 0.33
Vapor Pressure (kPa) 3.6 (1.1) 3.8 (0.9) -1.1 0.28
Prey Presence (n)


0.91
    0 99 (74%) 18 (86%)

    1 23 (17%) 2 (9.5%)

    2 7 (5.2%) 1 (4.8%)

    3 3 (2.2%) 0 (0%)

    4 1 (0.7%) 0 (0%)

    11 1 (0.7%) 0 (0%)

data_transect_cal$detection <- as.factor(data_transect_cal$detection)
gathered_det_cal <- data_transect_cal %>%
  select(
    detection,
    elev,
    air_temp,
    gr_temp,
    avg_wind_spd,
    rock_ind_avg,
    shr_dens,
    vap_pres_kPa,
    prey_pres
  ) %>%
    gather(-detection, key="var", value = "value")


ggplot(gathered_det_cal, aes(x = detection, y = value)) +
    geom_boxplot() +
    geom_point() +
    facet_wrap(~var, scales = "free") +
    theme_bw() +
    scale_x_discrete(labels = labels_det)

data_transect_vof$detection <- as.factor(data_transect_vof$detection)
gathered_det_vof <- data_transect_vof %>%
  select(
    detection,
    elev,
    air_temp,
    gr_temp,
    avg_wind_spd,
    rock_ind_avg,
    shr_dens,
    vap_pres_kPa,
    prey_pres
  ) %>%
    gather(-detection, key="var", value = "value")

ggplot(gathered_det_vof, aes(x = detection, y = value)) +
    geom_boxplot() +
    geom_point() +
    facet_wrap(~var, scales = "free") +
    theme_bw() +
    scale_x_discrete(labels = labels_det)