Canopy cover

library(readxl)
library(ggplot2)
canopyagg <- read_excel("Field data single park transects.xlsx", sheet = "Canopy agg")
ggplot(canopyagg, aes(x = Distance_CBD, y = canopy_cover)) +
  geom_point() + 
  geom_smooth(method = "loess") +
  labs(x = "Distance from CBD (km)", y = "Canopy cover (%)") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

ggplot(canopyagg, aes(x = Distance_CBD, y = canopy_cover, color = Site_type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) + 
  labs(x = "Distance from CBD (km)", y = "Canopy cover (%)", color = "Site Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

Understorey density

under_dens_agg <- read_excel("Field data single park transects.xlsx", sheet = "Under agg")
ggplot(under_dens_agg, aes(x = Distance_CBD, y = Understorey_density)) +
  geom_point() + 
  geom_smooth(method = "loess") +
  labs(x = "Distance from CBD (km)", y = "Understorey density (1-5))") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

ggplot(under_dens_agg, aes(x = Distance_CBD, y = Understorey_density, color = Site_type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) +  
  labs(x = "Distance from CBD (km)", y = "Understorey density (1-5))", color = "Site Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

Shrub density

shrub_dens_agg <- read_excel("Field data single park transects.xlsx", sheet = "Shrub agg")
ggplot(shrub_dens_agg, aes(x = Distance_CBD, y = Shrub_density)) +
  geom_point() + 
  geom_smooth(method = "loess") +
  labs(x = "Distance from CBD (km)", y = "Shrub density (1-5)") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

ggplot(shrub_dens_agg, aes(x = Distance_CBD, y = Shrub_density, color = Site_type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) +  
  labs(x = "Distance from CBD (km)", y = "Shrub density (1-5))", color = "Site Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

Ground

library(tidyr)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
ground_agg <- read_excel("Field data single park transects.xlsx", sheet = "Ground agg")

# Reshape the data from wide to long format
ground_cover_long <- ground_agg %>%
  pivot_longer(cols = c(`Vegetation`, `Leaf litter`, `Bare soil`),
               names_to = "Ground_Cover_Type",
               values_to = "Percentage")

# Overall sites
ggplot(ground_cover_long, aes(x = Distance_CBD, y = Percentage, color = Ground_Cover_Type)) +
  geom_point() +  # Scatterplot of ground cover percentage vs. distance
  geom_smooth(method = "loess", se = FALSE) +  # Trend lines for each ground cover type
  labs(x = "Distance from CBD (km)", y = "Ground Cover (%)", color = "Ground Cover Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

Corridor sites

corridor_ground <- ground_agg %>%
  filter(Site_type == "Corridor")

# Reshape the data from wide to long format
corridor_long <- corridor_ground %>%
  pivot_longer(cols = c(`Bare soil`, `Vegetation`, `Leaf litter`),
               names_to = "Ground_Cover_Type",
               values_to = "Percentage")

# Create scatterplot with trend lines for corridor sites only
ggplot(corridor_long, aes(x = Distance_CBD, y = Percentage, color = Ground_Cover_Type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) +  
  labs(x = "Distance from CBD (km)", y = "Ground Cover (%)", color = "Ground Cover Type", title = "Ground cover percentages of corridor sites") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

Verge sites

verge_ground <- ground_agg %>%
  filter(Site_type == "Verge")

# Reshape the data from wide to long format
verge_long <- verge_ground %>%
  pivot_longer(cols = c(`Bare soil`, `Vegetation`, `Leaf litter`),
               names_to = "Ground_Cover_Type",
               values_to = "Percentage")

# Create scatterplot with trend lines for corridor sites only
ggplot(verge_long, aes(x = Distance_CBD, y = Percentage, color = Ground_Cover_Type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) +  
  labs(x = "Distance from CBD (km)", y = "Ground Cover (%)", color = "Ground Cover Type", title = "Ground cover percentages of verge sites") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

Park sites

park_ground <- ground_agg %>%
  filter(Site_type == "Park")

# Reshape the data from wide to long format
park_long <- park_ground %>%
  pivot_longer(cols = c(`Bare soil`, `Vegetation`, `Leaf litter`),
               names_to = "Ground_Cover_Type",
               values_to = "Percentage")

# Create scatterplot with trend lines for corridor sites only
ggplot(park_long, aes(x = Distance_CBD, y = Percentage, color = Ground_Cover_Type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) +  
  labs(x = "Distance from CBD (km)", y = "Ground Cover (%)", color = "Ground Cover Type", title = "Ground cover percentages of park sites") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

Strata height

Strata height using avgs

strata_agg_avg <- read_excel("Field data single park transects.xlsx", sheet = "Strata agg avg")

# Reshape the data from wide to long format
strata_long <- strata_agg_avg %>%
  pivot_longer(cols = c(`Canopy`, `Understorey`, `Shrub`, `Ground`),
               names_to = "Strata_Type",
               values_to = "Centimetres")

# Overall sites
ggplot(strata_long, aes(x = Distance_CBD, y = Centimetres, color = Strata_Type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) + 
  labs(x = "Distance from CBD (km)", y = "Strata height (cm)", color = "Strata Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

By max values

strata_agg_max <- read_excel("Field data single park transects.xlsx", sheet = "Strata agg max")

# Reshape the data from wide to long format
strata_max_long <- strata_agg_max %>%
  pivot_longer(cols = c(`Canopy`, `Understorey`, `Shrub`, `Ground`),
               names_to = "Strata_Type",
               values_to = "Centimetres")

# Overall sites
ggplot(strata_max_long, aes(x = Distance_CBD, y = Centimetres, color = Strata_Type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) + 
  labs(x = "Distance from CBD (km)", y = "Strata height (cm)", color = "Strata Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

Logs

logs_agg <- read_excel("Field data single park transects.xlsx", sheet = "Logs agg")

ggplot(logs_agg, aes(x = Distance_CBD, y = Log_count)) +
  geom_point() + 
  geom_smooth(method = "loess") +
  labs(x = "Distance from CBD (km)", y = "Number of logs") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 5 rows containing non-finite outside the scale range
## (`stat_smooth()`).
## Warning: Removed 5 rows containing missing values or values outside the scale range
## (`geom_point()`).

ggplot(logs_agg, aes(x = Distance_CBD, y = Log_count, color = Site_type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) + 
  labs(x = "Distance from CBD (km)", y = "Number of logs", color = "Site Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 5 rows containing non-finite outside the scale range (`stat_smooth()`).
## Removed 5 rows containing missing values or values outside the scale range
## (`geom_point()`).

Hollows

hollows_agg <- read_excel("Field data single park transects.xlsx", sheet = "Hollows agg")

ggplot(hollows_agg, aes(x = Distance_CBD, y = Hollow_count)) +
  geom_point() + 
  geom_smooth(method = "loess") +
  labs(x = "Distance from CBD (km)", y = "Number of hollows") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

ggplot(hollows_agg, aes(x = Distance_CBD, y = Hollow_count, color = Site_type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) + 
  labs(x = "Distance from CBD (km)", y = "Number of hollows", color = "Site Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

Overall species abundance

library(readxl)
overall_CBD <- read_excel("Spp per site and strata.xlsx", sheet = "Sprich")

ggplot(overall_CBD, aes(x = Distance_CBD, y = Abundance)) +
  geom_point() + 
  geom_smooth(method = "loess") +
  labs(x = "Distance from CBD (km)", y = "Abundance") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

ggplot(overall_CBD, aes(x = Distance_CBD, y = Abundance, color = Site_type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) + 
  labs(x = "Distance from CBD (km)", y = "Species abundance", color = "Site Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

Trees

Tree DBH

tree_agg <- read_excel("Field data single park transects.xlsx", sheet = "Tree agg")

tree_agg_sprich <- tree_agg %>%
group_by(Site, Site_type, Distance_CBD) %>%
  summarise(richness = n_distinct(`Spp ID`))
## `summarise()` has grouped output by 'Site', 'Site_type'. You can override using
## the `.groups` argument.
ggplot(tree_agg, aes(x = Distance_CBD, y = DBH)) +
  geom_point() + 
  geom_smooth(method = "loess") +
  labs(x = "Distance from CBD (km)", y = "Tree DBH") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

ggplot(tree_agg_sprich, aes(x = Distance_CBD, y = richness, color = Site_type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) + 
  labs(x = "Distance from CBD (km)", y = "Tree DBH", color = "Site Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

Tree spp richness

ggplot(tree_agg_sprich, aes(x = Distance_CBD, y = richness)) +
  geom_point() + 
  geom_smooth(method = "loess") +
  labs(x = "Distance from CBD (km)", y = "Tree species richness") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

ggplot(tree_agg_sprich, aes(x = Distance_CBD, y = richness, color = Site_type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) + 
  labs(x = "Distance from CBD (km)", y = "Tree species richness", color = "Site Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

Tree spp abundance

tree_agg_abund <- tree_agg %>%
  group_by(Site, Site_type, Distance_CBD) %>%
  summarise(abundance = n())
## `summarise()` has grouped output by 'Site', 'Site_type'. You can override using
## the `.groups` argument.
ggplot(tree_agg_abund, aes(x = Distance_CBD, y = abundance)) +
  geom_point() + 
  geom_smooth(method = "loess") +
  labs(x = "Distance from CBD (km)", y = "Tree species abundance") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

ggplot(tree_agg_abund, aes(x = Distance_CBD, y = abundance, color = Site_type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) + 
  labs(x = "Distance from CBD (km)", y = "Tree species abundance", color = "Site Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

Saplings

Sapling spp abundance

sapling_agg <- read_excel("Field data single park transects.xlsx", sheet = "Saplings agg")

ggplot(sapling_agg, aes(x = Distance_CBD, y = Abundance)) +
  geom_point() + 
  geom_smooth(method = "loess") +
  labs(x = "Distance from CBD (km)", y = "Sapling species abundance") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

ggplot(sapling_agg, aes(x = Distance_CBD, y = Abundance, color = Site_type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) + 
  labs(x = "Distance from CBD (km)", y = "Sapling species abundance", color = "Site Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

Sapling spp richness

sapling_agg_sprich <- sapling_agg %>%
group_by(Site, Site_type, Distance_CBD) %>%
  summarise(richness = n_distinct(`Species`))
## `summarise()` has grouped output by 'Site', 'Site_type'. You can override using
## the `.groups` argument.
ggplot(sapling_agg_sprich, aes(x = Distance_CBD, y = richness)) +
  geom_point() + 
  geom_smooth(method = "loess") +
  labs(x = "Distance from CBD (km)", y = "Sapling species richness") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

ggplot(sapling_agg_sprich, aes(x = Distance_CBD, y = richness, color = Site_type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) + 
  labs(x = "Distance from CBD (km)", y = "Sapling species richness", color = "Site Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

Shrub spp

Shrub spp abundance

shrub_agg <- read_excel("Field data single park transects.xlsx", sheet = "Shrub spp agg")

ggplot(shrub_agg, aes(x = Distance_CBD, y = Abundance)) +
  geom_point() + 
  geom_smooth(method = "loess") +
  labs(x = "Distance from CBD (km)", y = "Shrub species abundance") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

ggplot(shrub_agg, aes(x = Distance_CBD, y = Abundance, color = Site_type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) + 
  labs(x = "Distance from CBD (km)", y = "Shrub species abundance", color = "Site Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

Shrub spp richness

shrub_agg_sprich <- shrub_agg %>%
group_by(Site, Site_type, Distance_CBD) %>%
  summarise(richness = n_distinct(`Spp ID`))
## `summarise()` has grouped output by 'Site', 'Site_type'. You can override using
## the `.groups` argument.
ggplot(shrub_agg_sprich, aes(x = Distance_CBD, y = richness)) +
  geom_point() + 
  geom_smooth(method = "loess") +
  labs(x = "Distance from CBD (km)", y = "Shrub species richness") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

ggplot(shrub_agg_sprich, aes(x = Distance_CBD, y = richness, color = Site_type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) + 
  labs(x = "Distance from CBD (km)", y = "Shrub species richness", color = "Site Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

Floor spp

Floor spp abundance

floor_agg <- read_excel("Field data single park transects.xlsx", sheet = "Floor spp agg")

ggplot(floor_agg, aes(x = Distance_CBD, y = Abundance)) +
  geom_point() + 
  geom_smooth(method = "loess") +
  labs(x = "Distance from CBD (km)", y = "Floor species abundance") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

ggplot(floor_agg, aes(x = Distance_CBD, y = Abundance, color = Site_type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) + 
  labs(x = "Distance from CBD (km)", y = "Floor species abundance", color = "Site Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

Floor spp richness

floor_agg_sprich <- floor_agg %>%
group_by(Site, Site_type, Distance_CBD) %>%
  summarise(richness = n_distinct(`Spp ID`))
## `summarise()` has grouped output by 'Site', 'Site_type'. You can override using
## the `.groups` argument.
ggplot(floor_agg_sprich, aes(x = Distance_CBD, y = richness)) +
  geom_point() + 
  geom_smooth(method = "loess") +
  labs(x = "Distance from CBD (km)", y = "Floor species richness") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

ggplot(floor_agg_sprich, aes(x = Distance_CBD, y = richness, color = Site_type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) + 
  labs(x = "Distance from CBD (km)", y = "Floor species richness", color = "Site Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

Other spp

Other spp abundance

other_agg <- read_excel("Field data single park transects.xlsx", sheet = "Other spp agg")

ggplot(other_agg, aes(x = Distance_CBD, y = Abundance)) +
  geom_point() + 
  geom_smooth(method = "loess") +
  labs(x = "Distance from CBD (km)", y = "Other species abundance") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

ggplot(other_agg, aes(x = Distance_CBD, y = Abundance, color = Site_type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) + 
  labs(x = "Distance from CBD (km)", y = "Other species abundance", color = "Site Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

Other spp richness

other_agg_sprich <- other_agg %>%
group_by(Site, Site_type, Distance_CBD) %>%
  summarise(richness = n_distinct(`Spp ID`))
## `summarise()` has grouped output by 'Site', 'Site_type'. You can override using
## the `.groups` argument.
ggplot(other_agg_sprich, aes(x = Distance_CBD, y = richness)) +
  geom_point() + 
  geom_smooth(method = "loess") +
  labs(x = "Distance from CBD (km)", y = "Other species richness") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

ggplot(other_agg_sprich, aes(x = Distance_CBD, y = richness, color = Site_type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) + 
  labs(x = "Distance from CBD (km)", y = "Other species richness", color = "Site Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

Floral resources

By number of flowers

floral_agg <- read_excel("Field data single park transects.xlsx", sheet = "Floral agg")

ggplot(floral_agg, aes(x = Distance_CBD, y = No_flowers)) +
  geom_point() + 
  geom_smooth(method = "loess") +
  labs(x = "Distance from CBD (km)", y = "Number of flowers") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

ggplot(floral_agg, aes(x = Distance_CBD, y = No_flowers, color = Site_type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) + 
  labs(x = "Distance from CBD (km)", y = "Number of flowers", color = "Site Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

By no of floral units

ggplot(floral_agg, aes(x = Distance_CBD, y = No_floral_units)) +
  geom_point() + 
  geom_smooth(method = "loess") +
  labs(x = "Distance from CBD (km)", y = "Number of inflorescences") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'

ggplot(floral_agg, aes(x = Distance_CBD, y = No_floral_units, color = Site_type)) +
  geom_point() +  
  geom_smooth(method = "loess", se = FALSE) + 
  labs(x = "Distance from CBD (km)", y = "Number of inflorescences", color = "Site Type") +
  theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'