setwd(“C:/Users/USER/OneDrive/Desktop/Data Science Resources/R studio/Ongoing projects/West Pokot”) getwd()

#A. DESCRIPTION AND SUMMARY OF WET SEASON DATA # Import the wet season quadrat data set library(readxl) Quadrat_Wet <- read_excel(“WP_Vegetation.xlsx”, sheet = 3) View (Quadrat_Wet) colnames(Quadrat_Wet)

Subsetting the grasses data for description, summarisation and analysis

Grasses_Wet <- Quadrat_Wet [Quadrat_Wet$Lifeform == “Grass”,] View(Grasses_Wet)

1. SPECIES DIVERSITY

Calculating the diversity of species using the Shannon-Weiner index, a widely-used measure in ecology, implemented through the ‘vegan’ package in R, which facilitates comprehensive analysis of ecological communities.

library(vegan)

Calculating the diversity index for grass species observed in Chepararia, Riwo, and Suam wards during the wet season.

Exploring the diversity of grass species specifically within the Chepararia Ward

Grass_Diversity_Wet_Chep <- diversity(Grasses_Wet$Chepararia, index = “shannon”) print(Grass_Diversity_Wet_Chep)

Investigating the diversity of grass species within Riwo ward

Grass_Diversity_Wet_Riwo <- diversity(Grasses_Wet$Riwo, index = “shannon”) print(Grass_Diversity_Wet_Riwo)

Examining the diversity of grass species within the Suam Ward

Grass_Diversity_Wet_Suam <- diversity(Grasses_Wet$Suam, index = “shannon”) print(Grass_Diversity_Wet_Suam)

Calculating the Diversity Index of Forbs Across Chepararia, Riwo, and Suam During the Wet Season.

Subset the data for forbs from the Quadrat_Wet dataset, which contains observations from the wet season.

Forbs_Wet <- Quadrat_Wet [Quadrat_Wet$Lifeform == “Forb”, ] View(Forbs_Wet) library(tidyverse) Forbs_Wet <- Forbs_Wet %>% select (-Habit) print(Forbs_Wet)

Calculating the Diversity Index of Forbs in Chepararia ward

Forb_Diversity_Wet_Chep <- diversity(Forbs_Wet$Chepararia, index = “shannon”) print(Forb_Diversity_Wet_Chep)

Calculating the Diversity Index of Forbs in Riwo ward

Forb_Diversity_Wet_Riwo <- diversity(Forbs_Wet$Riwo, index = “shannon”) print(Forb_Diversity_Wet_Riwo)

Calculating the Diversity Index of Forbs in Suam Ward

Forb_Diversity_Wet_Suam <- diversity(Forbs_Wet$Suam, index = “shannon”) print(Forb_Diversity_Wet_Suam)

Diversity Index of Shrubs Across Chepararia, Riwo, and Suam During the Wet Season

Subset the data for shrubs from the Quadrat_Wet dataset, which contains observations from the wet season.

Shrubs_Wet <- Quadrat_Wet %>% filter(Lifeform == “Shrub”) %>% select(-Habit) View(Shrubs_Wet)

Quantifying Shrub Diversity Index in Chepararia Ward

Shrub_Diversity_Wet_Chep <- diversity(Shrubs_Wet$Chepararia, index = “shannon”) print(Shrub_Diversity_Wet_Chep)

Assessing Shrub Diversity Index in Riwo Ward

Shrub_Diversity_Wet_Riwo <- diversity(Shrubs_Wet$Riwo, index = “shannon”) print(Shrub_Diversity_Wet_Riwo)

Calculating the Shrub Diversity Index in Suam Ward

Shrub_Diversity_Wet_Suam <- diversity(Shrubs_Wet$Suam, index = “shannon”) print(Shrub_Diversity_Wet_Suam)

Quantifying the Tree Diversity Indexes Across Chepararia, Riwo, and Suam wards During the Wet Season

Selecting Tree Data from the Quadrat_Wet Dataset

Trees_Wet <- Quadrat_Wet %>% filter(Lifeform == “Tree”) %>% select(-Habit) View(Trees_Wet)

Computing the diversity index of trees in Chepararia Ward

Tree_Diversity_Wet_Chep <- diversity(Trees_Wet$Chepararia, index = “shannon”) print(Tree_Diversity_Wet_Chep)

Determining the tree diversity index in Riwo Ward

Tree_Diversity_Wet_Riwo <- diversity(Trees_Wet$Riwo, index = “shannon”) print(Tree_Diversity_Wet_Riwo)

Computing tree diversity index in Suam Ward

Tree_Diversity_Wet_Suam <- diversity(Trees_Wet$Suam, index = “shannon”) print(Tree_Diversity_Wet_Suam)

Creating a data frame of the wet season diversity indexes using vectors created from the diversity indexes of each life form in each ward.

Lifeforms <- c (“Grasses”, “Forb”, “Shrubs”, “Trees”) Diversity_Wet_Chepararia <- c (Grass_Diversity_Wet_Chep, Forb_Diversity_Wet_Chep, Shrub_Diversity_Wet_Chep, Tree_Diversity_Wet_Chep) Diversity_Wet_Riwo <- c (Grass_Diversity_Wet_Riwo, Forb_Diversity_Wet_Riwo, Shrub_Diversity_Wet_Riwo, Tree_Diversity_Wet_Riwo) Diversity_Wet_Suam <- c (Grass_Diversity_Wet_Suam, Forb_Diversity_Wet_Suam, Shrub_Diversity_Wet_Suam, Tree_Diversity_Wet_Suam)

Species_Diversity_Wet <- data.frame(Lifeforms, Diversity_Wet_Chepararia, Diversity_Wet_Riwo, Diversity_Wet_Suam) print(Species_Diversity_Wet)

Renaming the dataframe’s column names

colnames(Species_Diversity_Wet) <- c (“Lifeforms”, “Chepararia”, “Riwo”, “Suam”) print(Species_Diversity_Wet)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package (Tidyverse was already previously loaded onto R)

Species_Diversity_Wet_Long <- Species_Diversity_Wet %>% pivot_longer(cols = c(“Chepararia”, “Riwo”, “Suam”), names_to = “Wards”, values_to = “Diversity”) print(Species_Diversity_Wet_Long)

library(ggthemes)

ggplot(data = Species_Diversity_Wet_Long, mapping = aes(x = Wards, y = Diversity, fill = Lifeforms)) + geom_bar(stat = “identity”, position = “dodge”) + labs(title = “Wet Season Species Diversity in Wards of West Pokot County”, x = “Wards”, y = “Diversity Index”, fill = “Life Forms”) + theme_minimal()

ANOVA to assess variations in species diversity among the three wards”

Anova_Diversity_Wet <- aov (Diversity ~ Wards, data = Species_Diversity_Wet_Long) summary(Anova_Diversity_Wet)

2. DENSITY OF SPECIES DURING THE WET SEASON

Species density (Individuals/ha) = Total number of Identified Species/Total Sample Plot Area * 10,000m2.

The sample plot for grasses and forbs measured 0.5m0.5m = 0.25m2, shrubs measured 5m5m= 25m2, and trees were sampled within a 10m*10m quadrat = 100m2.

The Quadrat_Wet dataset will be used.

2.1 Density of grass species across the three wards

Density of grasses in Chepararia during the wet season

Density_Grasses_Wet_Chep <- Grasses_Wet$Chepararia/0.25 *10000 print(Density_Grasses_Wet_Chep)

Density of grasses in Riwo during the wet season

Density_Grasses_Wet_Riwo <- Grasses_Wet$Riwo/0.25*10000 print(Density_Grasses_Wet_Riwo)

Density of grasses in Suam during the wet season

Density_Grasses_Wet_Suam <- Grasses_Wet$Suam/0.25*10000 print(Density_Grasses_Wet_Suam)

Create a data frame of the grass species density across the three Wards (Land use systems)

Density_Grasses_Wet <- data.frame(Grasses_Wet$Species, Density_Grasses_Wet_Chep, Density_Grasses_Wet_Riwo, Density_Grasses_Wet_Suam) print(Density_Grasses_Wet)

Rename the column names for the Forbs density dataset

colnames(Density_Grasses_Wet) <- c (“Grass Species”, “Chepararia”, “Riwo”, “Suam”) print(Density_Grasses_Wet)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package (Tidyverse was already previously loaded onto R)

Density_Grasses_Wet_Long <- Density_Grasses_Wet %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Density”) print(Density_Grasses_Wet_Long)

Anova analysis assess the impact of land use on grass species density during the wet season

Anova_Density_Grasses_Wet <- aov (Density ~ Wards, data = Density_Grasses_Wet_Long) summary (Anova_Density_Grasses_Wet)

Density of Forb species across the three wards

Density of Forbs in Chepareria during the wet season

Density_Forbs_Wet_Chep <- Forbs_Wet$Chepararia/0.25 *10000 print(Density_Forbs_Wet_Chep)

Density of Forbs in Riwo during the wet season

Density_Forbs_Wet_Riwo <- Forbs_Wet$Riwo/0.25 *10000 print(Density_Forbs_Wet_Riwo)

Density of Forbs in Suam during the wet season

Density_Forbs_Wet_Suam <- Forbs_Wet$Suam/0.25 *10000 print(Density_Forbs_Wet_Suam)

Create a data frame of the Forb species density across the three Wards (Land use systems)

Density_Forbs_Wet <- data.frame(Forbs_Wet$Species, Density_Forbs_Wet_Chep, Density_Forbs_Wet_Riwo, Density_Forbs_Wet_Suam) print(Density_Forbs_Wet)

Rename the column names for the Forbs density dataset

colnames(Density_Forbs_Wet) <- c (“Forb Species”, “Chepararia”, “Riwo”, “Suam”) print(Density_Forbs_Wet)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package (Tidyverse was already previously loaded onto R)

Density_Forbs_Wet_Long <- Density_Forbs_Wet %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Density”) print(Density_Forbs_Wet_Long)

Anova analysis assess the impact of land use on grass species density during the wet season

Anova_Density_Forbs_Wet <- aov (Density ~ Wards, data = Density_Forbs_Wet_Long) summary (Anova_Density_Forbs_Wet)

Density of Shrub Species in the three wards

Density of Shrubs in Chepareria during the wet season

Density_Shrubs_Wet_Chep <- Shrubs_Wet$Chepararia/25 *10000 print(Density_Shrubs_Wet_Chep)

Density of Shrubs in Riwo during the wet season

Density_Shrubs_Wet_Riwo <- Shrubs_Wet$Riwo/25 *10000 print(Density_Shrubs_Wet_Riwo)

Density of Shrubs in Suam during the wet season

Density_Shrubs_Wet_Suam <- Shrubs_Wet$Suam/25 *10000 print(Density_Shrubs_Wet_Suam)

Create a data frame of the shrub species density across the three Wards (Land use systems)

Density_Shrubs_Wet <- data.frame(Shrubs_Wet$Species , Density_Shrubs_Wet_Chep, Density_Shrubs_Wet_Riwo, Density_Shrubs_Wet_Suam) print(Density_Shrubs_Wet)

Rename the column names for the Shrubs density dataset

colnames(Density_Shrubs_Wet) <- c (“Shrub Species”, “Chepararia”, “Riwo”, “Suam”) print(Density_Shrubs_Wet)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Density_Shrubs_Wet_Long <- Density_Shrubs_Wet %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Density”) print(Density_Shrubs_Wet_Long)

Anova analysis assess the impact of land use on Shrub species density during the wet season

Anova_Density_Shrubs_Wet <- aov (Density ~ Wards, data = Density_Shrubs_Wet_Long) summary (Anova_Density_Shrubs_Wet)

Density of Tree Species in the three wards

Density of Trees in Chepareria during the wet season

Density_Trees_Wet_Chep <- Trees_Wet$Chepararia/100 *10000 print(Density_Trees_Wet_Chep)

#Density of Trees in Riwo during the wet season Density_Trees_Wet_Riwo <- Trees_Wet$Riwo/100 *10000 print(Density_Trees_Wet_Riwo)

Density of Shrubs in Suam during the wet season

Density_Trees_Wet_Suam <- Trees_Wet$Suam/100 *10000 print(Density_Trees_Wet_Suam)

Create a data frame of the Tree species density across the three Wards (Land use systems)

Density_Trees_Wet <- data.frame(Trees_Wet$Species,Density_Trees_Wet_Chep, Density_Trees_Wet_Riwo, Density_Trees_Wet_Suam) print(Density_Trees_Wet)

Rename the column names for the Trees density dataset

colnames(Density_Trees_Wet) <- c (“Tree Species”, “Chepararia”, “Riwo”, “Suam”) print(Density_Trees_Wet)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Density_Trees_Wet_Long <- Density_Trees_Wet %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Density”) print(Density_Trees_Wet_Long)

Anova analysis assess the impact of land use on Shrub species density during the wet season

Anova_Density_Trees_Wet <- aov (Density ~ Wards, data = Density_Trees_Wet_Long) summary (Anova_Density_Trees_Wet)

#3. SPECIES COMPOSITION # Species Count print(Quadrat_Wet) Quadrat_Wet %>% count(Lifeform == “Grass”) Quadrat_Wet %>% count(Lifeform == “Forb”) Quadrat_Wet %>% count(Lifeform == “Shrub”) Quadrat_Wet %>% count(Lifeform == “Tree”) Lifeforms <- c (“Grasses”, “Forbs”, “Shrubs”, “Trees”) Total_Count_Wet <- c(24,32,36,38) Grasses_Wet %>% count(Grasses_Wet\(Habit == "Increaser") Grasses_Wet %>% count(Grasses_Wet\)Habit == “Decreaser”) Grasses_Habit <- c (“Increasers”, “Decreasers”) Habits_Count_Wet <- c (15,9) Grasses_Habit_Count_Wet <- data.frame(Grasses_Habit, Habits_Count_Wet) print(Grasses_Habit_Count_Wet) Increasers_Wet <- (15/(15+9))100 print(Increasers_Wet) Decreasers_Wet <- (9/(15+9)100) print(Decreasers_Wet) percent_Habit_Count_Wet <- c(Increasers_Wet, Decreasers_Wet) Grasses_Habit_Percent_Wet <- data.frame(Grasses_Habit_Count_Wet, percent_Habit_Count_Wet) print(Grasses_Habit_Percent_Wet)

Percent Grass Species Composition

Percent Grass species Composition in Chepararia

sum(Grasses_Wet\(Chepararia) Composition_Grasses_Wet_Chep <- (Grasses_Wet\)Chepararia/463)*100 print(Composition_Grasses_Wet_Chep) sum(Composition_Grasses_Wet_Chep)

#Percent Grass species Composition in Riwo sum(Grasses_Wet\(Riwo) Composition_Grasses_Wet_Riwo <- (Grasses_Wet\)Riwo/531)*100 print(Composition_Grasses_Wet_Riwo) sum(Composition_Grasses_Wet_Riwo)

#Percent Grass species Composition in Suam sum(Grasses_Wet\(Suam) Composition_Grasses_Wet_Suam <- (Grasses_Wet\)Suam/573)*100 print(Composition_Grasses_Wet_Suam) sum(Composition_Grasses_Wet_Suam)

Create a data frame of the Grass species composition percent across the three Wards (Land use systems)

Composition_Grasses_Wet <- data.frame(Grasses_Wet$Species, Composition_Grasses_Wet_Chep, Composition_Grasses_Wet_Riwo, Composition_Grasses_Wet_Suam) print(Composition_Grasses_Wet)

Rename the column names for the Composition_Grasses_Wet newly created dataframe

colnames(Composition_Grasses_Wet) <- c (“Grass Species”, “Chepararia”, “Riwo”, “Suam”) print(Composition_Grasses_Wet)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Composition_Grasses_Wet_Long <- Composition_Grasses_Wet %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Composition”) print(Composition_Grasses_Wet_Long)

Anova analysis assess the impact of land use on Grass species composition during the wet season

Anova_Composition_Grasses_Wet <- aov (Composition ~ Wards, data = Composition_Grasses_Wet_Long) summary (Anova_Composition_Grasses_Wet)

#Percent Forb Species Composition #Percent Forbs composition in Chepararia sum(Forbs_Wet\(Chepararia) Composition_Forbs_Wet_Chep <- (Forbs_Wet\)Chepararia/184)*100 print(Composition_Forbs_Wet_Chep) sum(Composition_Forbs_Wet_Chep)

#Percent Forbs Composition in Riwo sum(Forbs_Wet\(Riwo) Composition_Forbs_Wet_Riwo <- (Forbs_Wet\)Riwo/265)*100 print(Composition_Forbs_Wet_Riwo) sum(Composition_Forbs_Wet_Riwo)

#Percent Forbs Composition in Suam sum(Forbs_Wet\(Suam) Composition_Forbs_Wet_Suam <- (Forbs_Wet\)Suam/275)*100 print(Composition_Forbs_Wet_Suam) sum(Composition_Forbs_Wet_Suam)

Create a data frame of the Forb species composition percentages across the three Wards (Land use systems)

Composition_Forbs_Wet <- data.frame(Forbs_Wet$Species, Composition_Forbs_Wet_Chep, Composition_Forbs_Wet_Riwo, Composition_Forbs_Wet_Suam) print(Composition_Forbs_Wet)

Rename the column names for the Composition_Grasses_Wet newly created dataframe

colnames(Composition_Forbs_Wet) <- c (“Forb Species”, “Chepararia”, “Riwo”, “Suam”) print(Composition_Forbs_Wet)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Composition_Forbs_Wet_Long <- Composition_Forbs_Wet %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Composition”) print(Composition_Forbs_Wet_Long)

Anova analysis assess the impact of land use on Grass species composition during the wet season

Anova_Composition_Forbs_Wet <- aov (Composition ~ Wards, data = Composition_Forbs_Wet_Long) summary (Anova_Composition_Forbs_Wet)

#Percent Shrub Species Composition #Percent Shrubs Composition in Chepararia sum(Shrubs_Wet\(Chepararia) Composition_Shrubs_Wet_Chep <- (Shrubs_Wet\)Chepararia/366)*100 print(Composition_Shrubs_Wet_Chep) sum(Composition_Shrubs_Wet_Chep)

#Percent Shrubs Composition in Riwo sum(Shrubs_Wet\(Riwo) Composition_Shrubs_Wet_Riwo <- (Shrubs_Wet\)Riwo/761)*100 print(Composition_Shrubs_Wet_Riwo) sum(Composition_Shrubs_Wet_Riwo)

#Percent Shrubs Composition in Suam sum(Shrubs_Wet\(Suam) Composition_Shrubs_Wet_Suam <- (Shrubs_Wet\)Suam/1216)*100 print(Composition_Shrubs_Wet_Suam) sum(Composition_Shrubs_Wet_Suam)

Create a data frame of the Shrub species composition percentages across the three Wards (Land use systems)

Composition_Shrubs_Wet <- data.frame(Shrubs_Wet$Species, Composition_Shrubs_Wet_Chep, Composition_Shrubs_Wet_Riwo, Composition_Shrubs_Wet_Suam) print(Composition_Shrubs_Wet)

Rename the column names for the Composition_Shrubs_Wet newly created dataframe

colnames(Composition_Shrubs_Wet) <- c (“Shrub Species”, “Chepararia”, “Riwo”, “Suam”) print(Composition_Shrubs_Wet)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Composition_Shrubs_Wet_Long <- Composition_Shrubs_Wet %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Composition”) print(Composition_Shrubs_Wet_Long)

Anova analysis assess the impact of land use on Grass species composition during the wet season

Anova_Composition_Shrubs_Wet <- aov (Composition ~ Wards, data = Composition_Shrubs_Wet_Long) summary (Anova_Composition_Shrubs_Wet)

#Percent Tree Species Composition #Percent Trees composition in Chepararia sum(Trees_Wet\(Chepararia) Composition_Trees_Wet_Chep <- (Trees_Wet\)Chepararia/208)*100 print(Composition_Trees_Wet_Chep) sum(Composition_Trees_Wet_Chep)

#Percent Trees composition in Riwo sum(Trees_Wet\(Riwo) Composition_Trees_Wet_Riwo <- (Trees_Wet\)Riwo/294)*100 print(Composition_Trees_Wet_Riwo) sum(Composition_Trees_Wet_Riwo)

#Percent Trees composition in Suam sum(Trees_Wet\(Suam, na.rm = TRUE) Composition_Trees_Wet_Suam <- (Trees_Wet\)Suam/286)*100 print(Composition_Trees_Wet_Suam) sum(Composition_Trees_Wet_Suam)

Create a data frame of the Tree species composition percentages across the three Wards (Land use systems)

Composition_Trees_Wet <- data.frame(Trees_Wet$Species, Composition_Trees_Wet_Chep, Composition_Trees_Wet_Riwo, Composition_Trees_Wet_Suam) print(Composition_Trees_Wet)

Rename the column names for the Composition_Grasses_Wet newly created dataframe

colnames(Composition_Trees_Wet) <- c (“Tree Species”, “Chepararia”, “Riwo”, “Suam”) print(Composition_Trees_Wet)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Composition_Trees_Wet_Long <- Composition_Trees_Wet %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Composition”) print(Composition_Trees_Wet_Long)

Anova analysis assess the impact of land use on Grass species composition during the wet season

Anova_Composition_Trees_Wet <- aov (Composition ~ Wards, data = Composition_Trees_Wet_Long) summary (Anova_Composition_Trees_Wet)

#4. WET SEASON GROUND COVER Point_Wet <- read_excel(“WP_Vegetation.xlsx”, sheet = 5) head(Point_Wet)

Ground Cover percent in Chepararia during the wet season

sum(Point_Wet\(Chepararia) Ground_Cover_Wet_Chep <- (Point_Wet\)Chepararia/238)*100 print(Ground_Cover_Wet_Chep)

#Ground Cover percent in Riwo sum(Point_Wet\(Riwo) Ground_Cover_Wet_Riwo <- (Point_Wet\)Riwo/247)*100 print(Ground_Cover_Wet_Riwo)

#Ground Cover percent in Suam sum(Point_Wet\(Suam) Ground_Cover_Wet_Suam <- (Point_Wet\)Suam/228)*100 print(Ground_Cover_Wet_Suam)

Creating a dataframe of ground cover across the three wards

Ground_Cover_Wet <- data.frame(Point_Wet$SPECIES, Ground_Cover_Wet_Chep, Ground_Cover_Wet_Riwo, Ground_Cover_Wet_Suam) print(Ground_Cover_Wet)

Renaming the column names of the dataframe

colnames(Ground_Cover_Wet) <- c (“Species”, “Chepararia”, “Riwo”, “Suam”) print(Ground_Cover_Wet) View(Ground_Cover_Wet) write_excel_csv(Ground_Cover_Wet, file = “Ground_Cover_Wet”)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Ground_Cover_Wet_Long <- Ground_Cover_Wet %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Cover”) print(Ground_Cover_Wet_Long)

Anova analysis assess the impact of land use on Grass species composition during the wet season

Anova_Ground_Cover_Wet <- aov (Cover ~ Wards, data = Ground_Cover_Wet_Long) summary (Anova_Ground_Cover_Wet)

#5. CANOPY COVER # Canopy Cover - a 10m long tape was being used to sample, on 3 points, in 4 campus directions per sampling point. #1034*2 - for 2 sampling locations = 240m. # The total length of the sampling tape per land use study area is 240m. # Import the Canopy_Wet data set Canopy_Wet <- read_xlsx(“WP_Vegetation.xlsx”, sheet = 7)

Sub-setting the canopy cover of shrubs from the Canopy_Wet dataset

Canopy_Shrubs_Wet <- subset(Canopy_Wet, Lifeform == “Shrub”,) View (Canopy_Shrubs_Wet)

Canopy cover of shrub species in Chepararia

sum(Canopy_Shrubs_Wet\(Chepareria) # Total shrub canopy cover in Chepararia = ~29.4% Canopy_Shrubs_Chep_Wet <- (Canopy_Shrubs_Wet\)Chepararia/29.4)*100 print(Canopy_Shrubs_Chep_Wet)

#Canopy cover of Shrub species in Riwo sum(Canopy_Shrubs_Wet\(Riwo) #Total shrub canopy cover in Riwo = ~61.9% Canopy_Shrubs_Riwo_Wet <- (Canopy_Shrubs_Wet\)Riwo/61.9)*100 print(Canopy_Shrubs_Riwo_Wet)

#Canopy cover of Shrub species in Suam sum(Canopy_Shrubs_Wet\(Suam) #Total shrub canopy cover in Suam = ~53.1% Canopy_Shrubs_Suam_Wet <- (Canopy_Shrubs_Wet\)Suam/53.1) print(Canopy_Shrubs_Suam_Wet)

Creating a dataframe of Canopy cover percetages across the three wards

Canopy_Shrubs_Wet <- data.frame(Canopy_Shrubs_Wet$Species, Canopy_Shrubs_Chep_Wet, Canopy_Shrubs_Riwo_Wet, Canopy_Shrubs_Suam_Wet) print(Canopy_Shrubs_Wet)

Renaming the column names of the dataframe

colnames(Canopy_Shrubs_Wet) <- c (“Shrub Species”, “Chepararia”, “Riwo”, “Suam”) print(Canopy_Shrubs_Wet) view(Canopy_Shrubs_Wet)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Canopy_Shrubs_Wet_Long <- Canopy_Shrubs_Wet %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Canopy”) print(Canopy_Shrubs_Wet_Long)

Anova analysis assess the impact of land use on Grass species composition during the wet season

Anova_Canopy_Shrubs_Wet <- aov (Canopy ~ Wards, data = Canopy_Shrubs_Wet_Long) summary (Anova_Canopy_Shrubs_Wet)

Canopy_Trees_Wet <- subset(Canopy_Wet, Lifeform == “Tree”) view(Canopy_Trees_Wet)

#Canopy cover by tree species in Chepararia sum(Canopy_Trees_Wet\(Chepararia) #Total tree canopy cover in Chepararia = ~167.5% Canopy_Trees_Chep_Wet <- (Canopy_Trees_Wet\)Chepararia/167.5)*100 print(Canopy_Trees_Chep_Wet)

#Canopy cover by tree species in Riwo sum(Canopy_Trees_Wet\(Riwo) #Total tree canopy cover in Riwo = ~195.6% Canopy_Trees_Riwo_Wet <- (Canopy_Trees_Wet\)Riwo/195.6)*100 print(Canopy_Trees_Riwo_Wet)

#Canopy cover by tree species in Suam sum(Canopy_Trees_Wet\(Suam) #Total tree canopy cover in Suam = ~111.8% Canopy_Trees_Suam_Wet <- (Canopy_Trees_Wet\)Suam/111.8)*100 print(Canopy_Trees_Suam_Wet)

Creating a data frame of tree Canopy cover percentages across the three wards

Canopy_Trees_Wet <- data.frame(Canopy_Trees_Wet$Species, Canopy_Trees_Chep_Wet, Canopy_Trees_Riwo_Wet, Canopy_Trees_Suam_Wet) print(Canopy_Trees_Wet)

Renaming the column names of the dataframe

colnames(Canopy_Trees_Wet) <- c (“Tree Species”, “Chepararia”, “Riwo”, “Suam”) print(Canopy_Trees_Wet) view(Canopy_Trees_Wet)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Canopy_Trees_Wet_Long <- Canopy_Trees_Wet %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Canopy”) print(Canopy_Trees_Wet_Long)

Anova analysis assess the impact of land use on tree canopy cover during the wet season

Anova_Canopy_Trees_Wet <- aov (Canopy ~ Wards, data = Canopy_Trees_Wet_Long) summary (Anova_Canopy_Trees_Wet)

#6. BIOMASS PRODUCTION #Import the biomass dataset Biomass_Wet <- read_xlsx(“WP_Vegetation.xlsx”, sheet = 9) print(Biomass_Wet)

#Samples were collected in 2 sampling points in each of the wards. To get an average of the biomass sample weight per ward, the sample weights are divided by 2. Biomass_Wet <- Biomass_Wet %>% slice(1:3) print(Biomass_Wet) Biomass_Wet_Chep <- (Biomass_Wet$Chepararia/2) print(Biomass_Wet_Chep)

Biomass_Wet_Riwo <- (Biomass_Wet$Riwo/2) print(Biomass_Wet_Riwo)

Biomass_Wet_Suam <- (Biomass_Wet$Suam/2) print(Biomass_Wet_Suam)

Biomass_Prod_Wet <- data.frame (Biomass_Wet$Lifeform, Biomass_Wet_Chep, Biomass_Wet_Riwo, Biomass_Wet_Suam) print(Biomass_Prod_Wet)

#To then approximate biomass production in tonnes per hectare, the sample weights will be divided by the area of the quadrat (0.25) then multiplied by 10,000m2 to convert to hectares, then divided by 1,000,000 to convert to tonnes - giving weight in tonnes/ha Biomass_Wet_Chep <- ((Biomass_Prod_Wet$Biomass_Wet_Chep /0.25 *10000)/1000000) print(Biomass_Wet_Chep)

Biomass_Wet_Riwo <- ((Biomass_Prod_Wet$Biomass_Wet_Riwo/0.25*10000)/1000000) print(Biomass_Wet_Riwo)

Biomass_Wet_Suam <- ((Biomass_Prod_Wet$Biomass_Wet_Suam/0.25*10000)/1000000) print(Biomass_Wet_Suam)

Creating a data frame of tree Canopy cover percentages across the three wards

Biomass_Wet_WP <- data.frame( Lifeform <- c(“Grasses”, “Forbs”, “Total Biomass”), Biomass_Wet_Chep, Biomass_Wet_Riwo, Biomass_Wet_Suam) print(Biomass_Wet_WP)

Renaming the column names of the dataframe

colnames(Biomass_Wet_WP) <- c (“Lifeform”, “Chepararia”, “Riwo”, “Suam”) print(Biomass_Wet_WP) View(Biomass_Wet_WP)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Biomass_Wet_WP_Long <- Biomass_Prod_Wet %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Biomass”) print(Biomass_Wet_WP_Long)

Anova analysis assess the impact of land use on tree canopy cover during the wet season

Anova_Biomass_Wet_WP <- aov (Biomass ~ Wards, data = Biomass_Wet_WP_Long) summary (Anova_Biomass_Wet_WP)

#7. FREQUENCY Frequency_Wet <- read_xlsx(“WP_Vegetation.xlsx”, sheet = 1) view(Frequency_Wet)

The dataset contains grass, forb, shrub, and tree species identified in 24 quadrats laid within sampling points across different 3 wards of West Pokot County.

Presence of a species within a quadrat is denoted by the species count.

The total number of individual species in a ward is calculated and recorded as “Total number of individuals”, as well as the total count of quadrats containing the species, represented as “Quadrat Count”.

Frequency percentage = (Quadrat Count/Total number of quadrats (24)) * 100

Species_Frequency_Wet <- Frequency_Wet %>% mutate (Frequency_Wet, (Frequency_Wet$Quadrat Count/24)*100) view(Species_Frequency_Wet)

Species_Frequency_Wet <- Species_Frequency_Wet %>% rename_at(30, ~ “Frequency”) view(Species_Frequency_Wet)

Sub-setting the frequency data for grasses from the Species_Frequency dataset

Frequency_Grasses_Wet <- subset(Species_Frequency_Wet, Lifeform == “Grass”) view(Frequency_Grasses_Wet)

Anova analysis assess the impact of land use on Grasses frequency during the wet season

Anova_Frequency_Grasses_Wet <- aov (Frequency ~ Ward, data = Frequency_Grasses_Wet) summary(Anova_Frequency_Grasses_Wet)

Sub-setting the frequency data for forbs from the Species_Frequency dataset

Frequency_Forbs_Wet <- subset(Species_Frequency_Wet, Lifeform == “Forb”) view(Frequency_Forbs_Wet)

Anova analysis assess the impact of land use on Forbs frequency during the wet season

Anova_Frequency_Forbs_Wet <- aov (Frequency ~ Ward, data = Frequency_Forbs_Wet) summary(Anova_Frequency_Forbs_Wet)

Sub-setting the frequency data for Shrubs from the Species_Frequency dataset

Frequency_Shrubs_Wet <- subset(Species_Frequency_Wet, Lifeform == “Shrub”) view(Frequency_Shrubs_Wet)

Anova analysis assess the impact of land use on Shrubs frequency during the wet season

Anova_Frequency_Shrubs_Wet <- aov (Frequency ~ Ward, data = Frequency_Shrubs_Wet) summary(Anova_Frequency_Shrubs_Wet)

Sub-setting the frequency data for Trees from the Species_Frequency dataset

Frequency_Trees_Wet <- subset(Species_Frequency_Wet, Lifeform == “Tree”) view(Frequency_Trees_Wet)

Anova analysis assess the impact of land use on trees frequency during the wet season

Anova_Frequency_Trees_Wet <- aov (Frequency ~ Ward, data = Frequency_Trees_Wet) summary(Anova_Frequency_Trees_Wet)

B. DRY SEASON

1. Frequency

Frequency_Dry <- read_xlsx(“WP_Vegetation.xlsx”, sheet = 2) View(Frequency_Dry)

Species_Frequency_Dry <- Frequency_Dry %>% mutate(Frequency_Dry, (Frequency_Dry$Quadrat Count/24 *100)) view(Species_Frequency_Dry)

Species_Frequency_Dry <- Species_Frequency_Dry %>% rename_at(30, ~ “Frequency”) view(Species_Frequency_Dry)

Sub-setting the frequency data for grasses from the Species_Frequency_Dry dataset

Frequency_Grasses_Dry <- subset(Species_Frequency_Dry, Lifeform == “Grass”) view(Frequency_Grasses_Dry)

Anova analysis assess the impact of land use on Grasses frequency during the wet season

Anova_Frequency_Grasses_Dry <- aov (Frequency ~ Ward, data = Frequency_Grasses_Dry) summary(Anova_Frequency_Grasses_Dry)

Sub-setting the frequency data for forbs from the Species_Frequency_Dry dataset

Frequency_Forbs_Dry <- subset(Species_Frequency_Dry, Lifeform == “Forb”) view(Frequency_Forbs_Dry)

Anova analysis assess the impact of land use on Forbs frequency during the wet season

Anova_Frequency_Forbs_Dry <- aov (Frequency ~ Ward, data = Frequency_Forbs_Dry) summary(Anova_Frequency_Forbs_Dry)

Sub-setting the frequency data for Shrubs from the Species_Frequency_Dry dataset

Frequency_Shrubs_Dry <- subset(Species_Frequency_Dry, Lifeform == “Shrub”) view(Frequency_Shrubs_Dry)

Anova analysis assess the impact of land use on Shrubs frequency during the wet season

Anova_Frequency_Shrubs_Dry <- aov (Frequency ~ Ward, data = Frequency_Shrubs_Dry) summary(Anova_Frequency_Shrubs_Dry)

Sub-setting the frequency data for Trees from the Species_Frequency_Dry dataset

Frequency_Trees_Dry <- subset(Species_Frequency_Dry, Lifeform == “Tree”) view(Frequency_Trees_Dry)

Anova analysis assess the impact of land use on trees frequency during the wet season

Anova_Frequency_Trees_Dry <- aov (Frequency ~ Ward, data = Frequency_Trees_Dry) summary(Anova_Frequency_Trees_Dry)

2. SPECIES DIVERSITY

Calculating the dry season species diversity index using the Shannon-Weiner index in the ‘vegan’ package.

library(readxl) library(vegan)

Quadrat_Dry <- read_xlsx(“WP_Vegetation.xlsx”, sheet = 4) View(Quadrat_Dry)

Grasses_Dry <- Quadrat_Dry [Quadrat_Dry$Lifeform == “Grass”,] view(Grasses_Dry)

Diversity index of grasses in Chepararia, Riwo and Suam during the wet season

Calculating the diversity index of Grasses in Chepararia

Grass_Diversity_Dry_Chep <- diversity (Grasses_Dry$Chepararia, index = “shannon”) print(Grass_Diversity_Dry_Chep)

Calculating the diversity index of Grasses in Riwo

Grass_Diversity_Dry_Riwo <- diversity(Grasses_Dry$Riwo, index = “shannon”) print(Grass_Diversity_Dry_Riwo)

Calculating the diversity index of Grasses in Suam

Grass_Diversity_Dry_Suam <- diversity(Grasses_Dry$Suam, index = “shannon”) print(Grass_Diversity_Dry_Suam)

Diversity index of Forbs in Chepareria, Riwo and Suam during the wet season

Forbs_Dry <- Quadrat_Dry %>% filter(Lifeform == “Forb”) %>% select(-Habit) view(Forbs_Dry)

Calculating the diversity index of Forbs in Chepararia

Forb_Diversity_Dry_Chep <- diversity(Forbs_Dry$Chepararia, index = “shannon”) print(Forb_Diversity_Dry_Chep)

Calculating the diversity index of Forbs in Riwo

Forb_Diversity_Dry_Riwo <- diversity(Forbs_Dry$Riwo, index = “shannon”) print(Forb_Diversity_Dry_Riwo)

Calculating the diversity index of Forbs in Suam

Forb_Diversity_Dry_Suam <- diversity(Forbs_Dry$Suam, index = “shannon”) print(Forb_Diversity_Dry_Suam)

Diversity index of Shrubs in Chepareria, Riwo and Suam during the wet season

Shrubs_Dry <- Quadrat_Dry %>% filter(Lifeform == “Shrub”) %>% select(-Habit) View(Shrubs_Dry)

Calculating the diversity index of Shrubs in Chepararia

Shrub_Diversity_Dry_Chep <- diversity(Shrubs_Dry$Chepararia, index = “shannon”) print(Shrub_Diversity_Dry_Chep)

Calculating the diversity index of Shrubs in Riwo

Shrub_Diversity_Dry_Riwo <- diversity(Shrubs_Dry$Riwo, index = “shannon”) print(Shrub_Diversity_Dry_Riwo)

Calculating the diversity index of Shrubs in Suam

Shrub_Diversity_Dry_Suam <- diversity(Shrubs_Dry$Suam, index = “shannon”) print(Shrub_Diversity_Dry_Suam)

Diversity index of Trees in Chepararia, Riwo and Suam during the wet season

Trees_Dry <- Quadrat_Dry %>% filter(Lifeform == “Tree”) %>% select(-Habit) View (Trees_Dry)

Calculating the diversity index of Trees in Chepararia

Tree_Diversity_Dry_Chep <- diversity(Trees_Dry$Chepararia, index = “shannon”) print(Tree_Diversity_Dry_Chep)

Calculating the diversity index of Trees in Riwo

Tree_Diversity_Dry_Riwo <- diversity(Trees_Dry$Riwo, index = “shannon”) print(Tree_Diversity_Dry_Riwo)

Calculating the diversity index of Trees in Suam

Tree_Diversity_Dry_Suam <- diversity(Trees_Dry$Suam, index = “shannon”) print(Tree_Diversity_Dry_Suam)

Create a data frame of the dry season diversity indexes of all the lifeforms across the three wards.

Diversity_Dry_Chepararia <- c (Grass_Diversity_Dry_Chep, Forb_Diversity_Dry_Chep, Shrub_Diversity_Dry_Chep, Tree_Diversity_Dry_Chep) Diversity_Dry_Riwo <- c (Grass_Diversity_Dry_Riwo, Forb_Diversity_Dry_Riwo, Shrub_Diversity_Dry_Riwo, Tree_Diversity_Dry_Riwo) Diversity_Dry_Suam <- c (Grass_Diversity_Dry_Suam, Forb_Diversity_Dry_Suam, Shrub_Diversity_Dry_Suam, Tree_Diversity_Dry_Suam)

Species_Diversity_Dry <- data.frame(Lifeforms, Diversity_Dry_Chepararia, Diversity_Dry_Riwo, Diversity_Dry_Suam) print(Species_Diversity_Dry) colnames(Species_Diversity_Dry) <- c(“Lifeforms”, “Chepararia”, “Riwo”, “Suam”) print(Species_Diversity_Dry)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

library(tidyverse) Species_Diversity_Dry_Long <- Species_Diversity_Dry %>% pivot_longer(cols = c(“Chepararia”, “Riwo”, “Suam”), names_to = “Wards”, values_to = “Diversity”) print(Species_Diversity_Wet_Long)

ANOVA to assess variations in species diversity among the three wards during the dry season

Anova_Diversity_Dry <- aov (Diversity ~ Wards, data = Species_Diversity_Dry_Long) summary(Anova_Diversity_Dry)

ggplot(data = Species_Diversity_Dry_Long, mapping = aes(x = Wards, y = Diversity, fill = Lifeforms)) + geom_bar(stat = “identity”, position = “dodge”) + labs(title = “Dry Season Species Diversity in Wards of West Pokot County”, x = “Wards”, y = “Diversity Index”, fill = “Life Forms”) + theme_minimal()

3. DENSITY OF SPECIES

Species density (Individuals/ha) = Total number of Identified Species/Total Sample Plot Area * 10,000m2.

The sample plot for grasses and forbs measured 0.5m0.5m = 0.25m2, shrubs measured 5m5m= 25m2, and trees were sampled within a 10m*10m quadrat = 100m2.

The Quadrat_Dry dataset will be used.

3.1 Density of grass species across the three wards

Density of grasses in Chepararia during the dry season

Density_Grasses_Dry_Chep <- Grasses_Dry$Chepararia/0.25 *10000 print(Density_Grasses_Dry_Chep)

Density of grasses in Riwo during the dry season

Density_Grasses_Dry_Riwo <- Grasses_Dry$Riwo/0.25 * 10000 print(Density_Grasses_Dry_Riwo)

Density of grasses in Suam during the dry season

Density_Grasses_Dry_Suam <- Grasses_Dry$Suam/0.25 * 10000 print(Density_Grasses_Dry_Suam)

Create a data frame of the wet season densities of Grasses across the three Wards (Land use systems)

Density_Grasses_Dry <- data.frame(Grasses_Dry$Species, Density_Grasses_Dry_Chep, Density_Grasses_Dry_Riwo, Density_Grasses_Dry_Suam) View(Density_Grasses_Dry) colnames(Density_Grasses_Dry) <- c (“Grass species”, “Chepararia”, “Riwo”, “Suam”) print(Density_Grasses_Dry)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package (Tidyverse was already previously loaded onto R)

Density_Grasses_Dry_Long <- Density_Grasses_Dry %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Density”) print(Density_Grasses_Dry_Long)

Anova analysis assess the impact of land use on grass species density during the wet season

Anova_Density_Grasses_Dry <- aov (Density ~ Wards, data = Density_Grasses_Dry_Long) summary (Anova_Density_Grasses_Dry)

Density of Forbs across the three wards

Density of Forbs in Chepararia during the dry season

Density_Forbs_Dry_Chep <- Forbs_Dry$Chepararia/0.25 *10000 print(Density_Forbs_Dry_Chep)

Density of Forbs in Riwo during the dry season

Density_Forbs_Dry_Riwo <- Forbs_Dry$Riwo/0.25 *10000 print(Density_Forbs_Dry_Riwo)

Density of Forbs in Suam during the dry season

Density_Forbs_Dry_Suam <- Forbs_Dry$Suam/0.25 * 10000 print(Density_Forbs_Dry_Suam)

Create a data frame of the wet season densities of Forbs across the three Wards (Land use systems)

Density_Forbs_Dry <- data.frame(Forbs_Dry$Species, Density_Forbs_Dry_Chep, Density_Forbs_Dry_Riwo, Density_Forbs_Dry_Suam) print(Density_Forbs_Dry) colnames(Density_Forbs_Dry) <- c(“Forb Species”, “Chepararia”, “Riwo”, “Suam”) print(Density_Forbs_Dry)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package (Tidyverse was already previously loaded onto R)

Density_Forbs_Dry_Long <- Density_Forbs_Dry %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Density”) print(Density_Forbs_Dry_Long)

Anova analysis assess the impact of land use on grass species density during the wet season

Anova_Density_Forbs_Dry <- aov (Density ~ Wards, data = Density_Forbs_Dry_Long) summary (Anova_Density_Forbs_Dry)

Density of Shrubs across the three wards

Density of Shrubs in Chepararia during the dry season

Density_Shrubs_Dry_Chep <- Shrubs_Dry$Chepararia/25 * 10000 print(Density_Shrubs_Dry_Chep)

Density of Shrubs in Riwo during the dry season

Density_Shrubs_Dry_Riwo <- Shrubs_Dry$Riwo/25 * 10000 print(Density_Shrubs_Dry_Riwo)

Density of Shrubs in Suam during the dry season

Density_Shrubs_Dry_Suam <- Shrubs_Dry$Suam/25 * 10000 print(Density_Shrubs_Dry_Suam)

Create a data frame of the dry season densities of Shrubs across the three Wards (Land use systems)

Density_Shrubs_Dry <- data.frame(Shrubs_Dry$Species, Density_Shrubs_Dry_Chep, Density_Shrubs_Dry_Riwo, Density_Shrubs_Dry_Suam) print(Density_Shrubs_Dry) colnames(Density_Shrubs_Dry) <- c(“Shrub Species”, “Chepararia”, “Riwo”, “Suam”) print(Density_Shrubs_Dry)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Density_Shrubs_Dry_Long <- Density_Shrubs_Dry %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Density”) print(Density_Shrubs_Dry_Long)

Anova analysis assess the impact of land use on Shrub species density during the dry season

Anova_Density_Shrubs_Dry <- aov (Density ~ Wards, data = Density_Shrubs_Dry_Long) summary (Anova_Density_Shrubs_Dry)

Density of Trees across the three wards

Density of Trees in Chepararia during the dry season

Density_Trees_Dry_Chep <- Trees_Dry$Chepararia/100 * 10000 print(Density_Trees_Dry_Chep)

Density of Trees in Riwo during the dry season

Density_Trees_Dry_Riwo <- Trees_Dry$Riwo/100 * 10000 print(Density_Trees_Dry_Riwo)

Density of Trees in Chepararia during the dry season

Density_Trees_Dry_Suam <- Trees_Dry$Suam/100*10000 print(Density_Trees_Dry_Suam)

Create a data frame of the dry season densities of Shrubs across the three Wards (Land use systems)

Density_Trees_Dry <- data.frame(Trees_Dry$Species, Density_Trees_Dry_Chep, Density_Trees_Dry_Riwo, Density_Trees_Dry_Suam) print(Density_Trees_Dry) colnames(Density_Trees_Dry) <- c(“Tree Species”, “Chepararia”, “Riwo”, “Suam”) print(Density_Trees_Dry)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Density_Trees_Dry_Long <- Density_Trees_Dry %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Density”) print(Density_Trees_Dry_Long)

Anova analysis assess the impact of land use on Shrub species density during the wet season

Anova_Density_Trees_Dry <- aov (Density ~ Wards, data = Density_Trees_Dry_Long) summary (Anova_Density_Trees_Dry)

SPECIES COMPOSITION

Species Count

Quadrat_Dry %>% count(Lifeform == “Grass”) Quadrat_Dry %>% count(Lifeform == “Forb”) Quadrat_Dry %>% count(Lifeform == “Shrub”) Quadrat_Dry %>% count(Lifeform == “Tree”) Lifeforms <- c (“Grasses”, “Forbs”, “Shrubs”, “Trees”) Total_Count_Dry <- c(21,15,39,38) Grasses_Dry %>% count(Grasses_Dry\(Habit == "Increaser") Grasses_Dry %>% count(Grasses_Dry\)Habit == “Decreaser”) Grasses_Habit <- c (“Increasers”, “Decreasers”) Habits_Count_Dry <- c (16,5) Grasses_Habit_Count_Dry <- data.frame(Grasses_Habit, Habits_Count_Dry) print(Grasses_Habit_Count_Dry) Increasers_Dry <- (16/(16+5))100 print(Increasers_Dry) Decreasers_Dry <- (5/(16+5)100) print(Decreasers_Dry) percent_Habit_Count_Dry <- c(Increasers_Dry, Decreasers_Dry) Grasses_Habit_Percent_Dry <- data.frame(Grasses_Habit_Count_Dry, percent_Habit_Count_Dry) print(Grasses_Habit_Percent_Dry)

Percent Grass Species Composition

Percent Grass species Composition in Chepararia during the dry season

sum(Grasses_Dry\(Chepararia) Composition_Grasses_Dry_Chep <- (Grasses_Dry\)Chepararia/340)*100 print(Composition_Grasses_Dry_Chep) sum(Composition_Grasses_Dry_Chep)

Percent Grass species Composition in Riwo during the dry season

sum(Grasses_Dry\(Riwo) Composition_Grasses_Dry_Riwo <- (Grasses_Dry\)Riwo/235)*100 print(Composition_Grasses_Dry_Riwo) sum(Composition_Grasses_Dry_Riwo)

Percent Grass species Composition in Suam during the dry season

sum(Grasses_Dry\(Suam) Composition_Grasses_Dry_Suam <- (Grasses_Dry\)Suam/79)*100 print(Composition_Grasses_Dry_Suam) sum(Composition_Grasses_Dry_Suam)

Creating a data frame of the percent grass species composition across the three wards.

Composition_Grasses_Dry <- data.frame(Grasses_Dry$Species, Composition_Grasses_Dry_Chep, Composition_Grasses_Dry_Riwo, Composition_Grasses_Dry_Suam) print(Composition_Grasses_Dry)

Rename the column names for the Composition_Grasses_Wet newly created dataframe

colnames(Composition_Grasses_Dry) <- c (“Grass Species”, “Chepararia”, “Riwo”, “Suam”) print(Composition_Grasses_Dry)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Composition_Grasses_Dry_Long <- Composition_Grasses_Dry %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Composition”) print(Composition_Grasses_Dry_Long)

Anova analysis assess the impact of land use on Grass species composition during the Dry season

Anova_Composition_Grasses_Dry <- aov (Composition ~ Wards, data = Composition_Grasses_Dry_Long) summary (Anova_Composition_Grasses_Dry)

Percent Forb Species Composition

Percent Forb species Composition in Chepararia during the dry season

sum(Forbs_Dry\(Chepararia) Composition_Forbs_Dry_Chep <- (Forbs_Dry\)Chepararia/68)*100 print(Composition_Forbs_Dry_Chep) sum(Composition_Forbs_Dry_Chep)

Percent Forb species Composition in Riwo during the dry season

sum(Forbs_Dry\(Riwo) Composition_Forbs_Dry_Riwo <- (Forbs_Dry\)Riwo/76)*100 print(Composition_Forbs_Dry_Riwo) sum(Composition_Forbs_Dry_Riwo)

Percent Forb species Composition in Suam during the dry season

sum(Forbs_Dry\(Suam) Composition_Forbs_Dry_Suam <- (Forbs_Dry\)Suam/26)*100 print(Composition_Forbs_Dry_Suam) sum(Composition_Forbs_Dry_Suam)

Creating a data frame containing the percent forb species composition of the three wards

Composition_Forbs_Dry <- data.frame(Forbs_Dry$Species, Composition_Forbs_Dry_Chep, Composition_Forbs_Dry_Riwo, Composition_Forbs_Dry_Suam) print(Composition_Forbs_Dry)

Rename the column names for the Composition_Forbs_Dry newly created dataframe

colnames(Composition_Forbs_Dry) <- c (“Forb Species”, “Chepararia”, “Riwo”, “Suam”) print(Composition_Forbs_Dry)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Composition_Forbs_Dry_Long <- Composition_Forbs_Dry %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Composition”) print(Composition_Forbs_Dry_Long)

Anova analysis assess the impact of land use on Forb species composition during the Dry season

Anova_Composition_Forbs_Dry <- aov (Composition ~ Wards, data = Composition_Forbs_Dry_Long) summary (Anova_Composition_Forbs_Dry)

Percent Shrub Species Composition

Percent Shrub species Composition in Chepararia during the dry season

sum(Shrubs_Dry\(Chepararia) Composition_Shrubs_Dry_Chep <- (Shrubs_Dry\)Chepararia/468)*100 print(Composition_Shrubs_Dry_Chep) sum(Composition_Shrubs_Dry_Chep)

Percent Shrub species Composition in Riwo during the dry season

sum(Shrubs_Dry\(Riwo) Composition_Shrubs_Dry_Riwo <- (Shrubs_Dry\)Riwo/661)*100 print(Composition_Shrubs_Dry_Riwo) sum(Composition_Shrubs_Dry_Riwo)

Percent Shrub species Composition in Suam during the dry season

sum(Shrubs_Dry\(Suam) Composition_Shrubs_Dry_Suam <- (Shrubs_Dry\)Suam/1331)*100 sum(Composition_Shrubs_Dry_Suam)

Creating a data frame containing the percent Shrub species composition of the three wards

Composition_Shrubs_Dry <- data.frame(Shrubs_Dry$Species, Composition_Shrubs_Dry_Chep, Composition_Shrubs_Dry_Riwo, Composition_Shrubs_Dry_Suam) print(Composition_Shrubs_Dry)

Rename the column names for the Composition_Shrubs_Dry newly created dataframe

colnames(Composition_Shrubs_Dry) <- c(“Shrub Species”, “Chepararia”, “Riwo”, “Suam”) print(Composition_Shrubs_Dry)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Composition_Shrubs_Dry_Long <- Composition_Shrubs_Dry %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Composition”) print(Composition_Shrubs_Dry_Long)

Anova analysis assess the impact of land use on Shrub species composition during the Dry season

Anova_Composition_Shrubs_Dry <- aov (Composition ~ Wards, data = Composition_Shrubs_Dry_Long) summary (Anova_Composition_Shrubs_Dry)

Percent Tree Species Composition

Percent Tree species Composition in Chepararia during the dry season

sum(Trees_Dry\(Chepararia) Composition_Trees_Dry_Chep <- (Trees_Dry\)Chepararia/330)*100 print(Composition_Trees_Dry_Chep) sum(Composition_Trees_Dry_Chep)

Percent Tree species Composition in Riwo during the dry season

sum(Trees_Dry\(Riwo) Composition_Trees_Dry_Riwo <- (Trees_Dry\)Riwo/435)*100 print(Composition_Trees_Dry_Riwo) sum(Composition_Trees_Dry_Riwo)

Percent Tree species Composition in Suam during the dry season

sum(Trees_Dry\(Suam) Composition_Trees_Dry_Suam <- (Trees_Dry\)Suam/251)*100 print(Composition_Trees_Dry_Suam) sum(Composition_Trees_Dry_Suam)

Creating a data frame containing the percent Tree species composition of the three wards

Composition_Trees_Dry <- data.frame(Trees_Dry$Species, Composition_Trees_Dry_Chep, Composition_Trees_Dry_Riwo, Composition_Trees_Dry_Suam) print(Composition_Trees_Dry)

Rename the column names for the Composition_Trees_Dry newly created dataframe

colnames(Composition_Trees_Dry) <- c(“Tree Species”, “Chepararia”, “Riwo”, “Suam”) print(Composition_Trees_Dry)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Composition_Trees_Dry_Long <- Composition_Trees_Dry %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Composition”) print(Composition_Trees_Dry_Long)

Anova analysis assess the impact of land use on Tree species composition during the Dry season

Anova_Composition_Trees_Dry <- aov (Composition ~ Wards, data = Composition_Trees_Dry_Long) summary (Anova_Composition_Trees_Dry)

DRY SEASON GROUND COVER

Point_Dry <- read_xlsx(“WP_Vegetation.xlsx”, sheet = 6) print(Point_Dry)

Ground Cover percent in Chepararia during the dry season

sum(Point_Dry\(Chepararia) Ground_Cover_Dry_Chep <- (Point_Dry\)Chepararia/240)*100 print(Ground_Cover_Dry_Chep)

Ground Cover percent in Riwo during the dry season

sum(Point_Dry\(Riwo) Ground_Cover_Dry_Riwo <- (Point_Dry\)Riwo/240)*100 print(Ground_Cover_Dry_Riwo)

Ground Cover percent in Suam during the dry season

sum(Point_Dry\(Suam) Ground_Cover_Dry_Suam <- (Point_Dry\)Suam/240)*100 print(Ground_Cover_Dry_Suam)

Creating a data frame containing the Ground cover percentages of species in the three wards

Ground_Cover_Dry <- data.frame(Point_Dry$Species, Ground_Cover_Dry_Chep, Ground_Cover_Dry_Riwo, Ground_Cover_Dry_Suam) print(Ground_Cover_Dry)

Rename the column names for the newly created dataframe

colnames(Ground_Cover_Dry) <- c(“Species”, “Chepararia”, “Riwo”, “Suam”) print(Ground_Cover_Dry)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Ground_Cover_Dry_Long <- Ground_Cover_Dry %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Cover”) print(Ground_Cover_Dry_Long)

Anova analysis assess the impact of land use on Grass species composition during the wet season

Anova_Ground_Cover_Dry <- aov (Cover ~ Wards, data = Ground_Cover_Dry_Long) summary (Anova_Ground_Cover_Dry)

#CANOPY COVER #Canopy Cover - a 10m long tape was being used to sample, on 3 points, in 4 campus directions per sampling point. #1034*2 - for 2 sampling locations = 240m. The total length of the sampling tape per land use study area is 240m. #Import the Canopy_Wet data set Canopy_Dry <- read_xlsx(“WP_Vegetation.xlsx”, sheet = 8) View(Canopy_Dry)

Subset the canopy cover data set for shrubs from the Canopy_Dry dataset

Canopy_Shrubs_Dry <- subset(Canopy_Dry, Lifeform == “Shrub”,) view(Canopy_Shrubs_Dry)

Canopy cover of shrubs in Chepararia during the dry season

sum(Canopy_Shrubs_Dry\(Chepararia) # Total shrub canopy cover in Chepararia during the dry season = ~ 7.3% Canopy_Shrubs_Dry_Chep <- (Canopy_Shrubs_Dry\)Chepararia/7.3)*100 print(Canopy_Shrubs_Dry_Chep)

Canopy cover of shrubs in Riwo during the dry season

sum(Canopy_Shrubs_Dry\(Riwo) # Total shrub canopy cover in Riwo during the dry season = ~ 50.35% Canopy_Shrubs_Dry_Riwo <- (Canopy_Shrubs_Dry\)Riwo/50.35)*100 print(Canopy_Shrubs_Dry_Riwo)

Canopy cover of shrubs in Suam during the dry season

sum(Canopy_Shrubs_Dry\(Suam) # Total shrub canopy cover in Suam during the dry season = ~ 27.3% Canopy_Shrubs_Dry_Suam <- (Canopy_Shrubs_Dry\)Suam/27.3)*100 print(Canopy_Shrubs_Dry_Suam)

Canopy_Cover_Shrubs_Dry <- data.frame(Canopy_Shrubs_Dry$Species, Canopy_Shrubs_Dry_Chep, Canopy_Shrubs_Dry_Riwo, Canopy_Shrubs_Dry_Suam) print(Canopy_Cover_Shrubs_Dry)

Rename the column names for the newly created dataframe

colnames(Canopy_Cover_Shrubs_Dry) <- c (“Shrub Species”, “Chepararia”, “Riwo”, “Suam”) print(Canopy_Cover_Shrubs_Dry)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Canopy_Shrubs_Dry_Long <- Canopy_Cover_Shrubs_Dry %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Canopy”) print(Canopy_Shrubs_Dry_Long)

Anova analysis assess the impact of land use on Grass species composition during the wet season

summary (Anova_Canopy_Shrubs_Dry <- aov (Canopy ~ Wards, data = Canopy_Shrubs_Dry_Long))

Subset the canopy cover data set for Trees from the Canopy_Dry data set

Canopy_Trees_Dry <- subset(Canopy_Dry, Lifeform == “Tree”) view(Canopy_Trees_Dry)

Canopy cover of Trees in Chepararia during the dry season

sum(Canopy_Trees_Dry\(Chepararia) # Total shrub canopy cover in Chepararia during the dry season = ~ 175.7% Canopy_Trees_Dry_Chep <- (Canopy_Trees_Dry\)Chepararia/175.7)*100 print(Canopy_Trees_Dry_Chep)

Canopy cover of Trees in Riwo during the dry season

sum(Canopy_Trees_Dry\(Riwo) # Total shrub canopy cover in Riwo during the dry season = ~ 190.3% Canopy_Trees_Dry_Riwo <- (Canopy_Trees_Dry\)Riwo/190.3)*100 print(Canopy_Trees_Dry_Riwo)

Canopy cover of shrubs in Suam during the dry season

sum(Canopy_Trees_Dry\(Suam) # Total shrub canopy cover in Suam during the dry season = ~ 188.4% Canopy_Trees_Dry_Suam <- (Canopy_Trees_Dry\)Suam/188.4)*100 print(Canopy_Trees_Dry_Suam)

Canopy_Cover_Trees_Dry <- data.frame(Canopy_Trees_Dry$Species, Canopy_Trees_Dry_Chep, Canopy_Trees_Dry_Riwo, Canopy_Trees_Dry_Suam) print(Canopy_Cover_Trees_Dry)

Rename the column names for the newly created dataframe

colnames(Canopy_Cover_Trees_Dry) <- c (“Tree Species”, “Chepararia”, “Riwo”, “Suam”) print(Canopy_Cover_Trees_Dry) View(Canopy_Cover_Trees_Dry)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Canopy_Trees_Dry_Long <- Canopy_Cover_Trees_Dry %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Canopy”) print(Canopy_Trees_Dry_Long)

Anova analysis assess the impact of land use on tree canopy cover during the Dry season

Anova_Canopy_Trees_Dry <- aov (Canopy ~ Wards, data = Canopy_Trees_Dry_Long) summary (Anova_Canopy_Trees_Dry)

DRY SEASON BIOMASS PRODUCTION

#Import the biomass dataset Biomass_Dry <- read_xlsx(“WP_Vegetation.xlsx”, sheet = 10) view(Biomass_Dry)

Biomass_Dry <- Biomass_Dry %>% slice(1:3) View(Biomass_Dry)

Biomass_Dry_Chep <- (Biomass_Dry$Chepararia/2) print(Biomass_Dry_Chep)

Biomass_Dry_Riwo <- (Biomass_Dry$Riwo/2) print(Biomass_Dry_Riwo)

Biomass_Dry_Suam <- (Biomass_Dry$Suam/2) print(Biomass_Dry_Suam)

Biomass_Prod_Dry <- data.frame (Biomass_Dry$Lifeform,Biomass_Dry_Chep, Biomass_Dry_Riwo, Biomass_Dry_Suam) print(Biomass_Prod_Dry)

#To then approximate biomass production in tonnes per hectare, the sample weights will be divided by the area of the quadrat (0.25) then multiplied by 10,000m2 to convert to hectares, then divided by 1,000,000 to convert to tonnes - giving weight in tonnes/ha Biomass_Dry_Chep <- ((Biomass_Prod_Dry$Biomass_Dry_Chep/0.25 *10000)/1000000) print(Biomass_Dry_Chep)

Biomass_Dry_Riwo <- ((Biomass_Prod_Dry$Biomass_Dry_Riwo/0.25*10000)/1000000) print(Biomass_Dry_Riwo)

Biomass_Dry_Suam <- ((Biomass_Prod_Dry$Biomass_Dry_Suam/0.25*10000)/1000000) print(Biomass_Dry_Suam)

Biomass_Dry_WP <- data.frame(Lifeform <- c(“Grasses”, “Forbs”, “Total Biomass”), Biomass_Dry_Chep, Biomass_Dry_Riwo, Biomass_Dry_Suam) print(Biomass_Dry_WP)

Rename the column names for the newly created data frame

colnames(Biomass_Dry_WP) <- c (“Lifeform”, “Chepararia”, “Riwo”, “Suam”) print(Biomass_Dry_WP)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Biomass_Dry_WP_Long <- Biomass_Prod_Dry %>% pivot_longer(cols = c(2:4), names_to = “Wards”, values_to = “Biomass”) print(Biomass_Dry_WP_Long)

Anova analysis assess the impact of land use on Biomass production during the Dry season

Anova_Biomass_Dry_WP <- aov (Biomass ~ Wards, data = Biomass_Dry_WP_Long) summary (Anova_Biomass_Dry_WP)

C. TESTING IF SEASONALITY HAS A SIGNIFICANT EFFECT ON THE VARIOUS VEGETATION ATTRIBUTES

C.1. SPECIES DIVERSITY

C.1.a. CHEPARARIA - AGROPASTORAL LAND USE SYSTEM

Chepararia_Diversity <- data.frame(Lifeforms, Diversity_Wet_Chepararia, Diversity_Dry_Chepararia) print(Chepararia_Diversity)

Rename the column names for the newly created dataframe

colnames(Chepararia_Diversity) <- c (“Lifeforms”, “Wet”, “Dry”) print(Chepararia_Diversity)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Chepararia_Diversity_Long <- Chepararia_Diversity %>% pivot_longer(cols = c(2,3), names_to = “Seasons”, values_to = “Diversity”) print(Chepararia_Diversity_Long)

Anova analysis assess the impact of land use on Biomass production during the Dry season

Anova_Chepararia_Diversity <- aov (Diversity ~ Seasons, data = Chepararia_Diversity_Long) summary (Anova_Chepararia_Diversity)

C.1.b RIWO - SEMI-TRANSHUMANCE LAND USE SYSTEM

Riwo_Diversity <- data.frame(Lifeforms, Diversity_Wet_Riwo, Diversity_Dry_Riwo) print(Riwo_Diversity)

Rename the column names for the newly created data frame

colnames(Riwo_Diversity) <- c (“Lifeforms”, “Wet”, “Dry”) print(Riwo_Diversity)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Riwo_Diversity_Long <- Riwo_Diversity %>% pivot_longer(cols = c(2,3), names_to = “Seasons”, values_to = “Diversity”) print(Riwo_Diversity_Long)

Anova analysis assess the impact of land use on Biomass production during the Dry season

Anova_Riwo_Diversity <- aov (Diversity ~ Seasons, data = Riwo_Diversity_Long) summary (Anova_Riwo_Diversity)

C.1.c SUAM - PASTORAL LAND USE SYSTEM

Suam_Diversity <- data.frame(Lifeforms, Diversity_Wet_Suam, Diversity_Dry_Suam) print(Suam_Diversity)

Rename the column names for the newly created data frame

colnames(Suam_Diversity) <- c (“Lifeforms”, “Wet”, “Dry”) print(Suam_Diversity)

Reshape the data into long format suitable for ANOVA using the pivot_longer function on the tidyr package

Suam_Diversity_Long <- Suam_Diversity %>% pivot_longer(cols = c(2,3), names_to = “Seasons”, values_to = “Diversity”) print(Suam_Diversity_Long)

Anova analysis assess the impact of land use on Biomass production during the Dry season

Anova_Suam_Diversity <- aov (Diversity ~ Seasons, data = Suam_Diversity_Long) summary (Anova_Suam_Diversity)

C.2. DENSITY

C.2.a CHEPARARIA - AGROPASTORAL LAND USE SYSTEM

Chepararia_Density_Wet <- data.frame (Grasses_Wet$Species, Density_Grasses_Wet_Chep) print(Chepararia_Density_Wet) colnames(Chepararia_Density_Wet) <- c (“Species”, “Density”) print(Chepararia_Density_Wet)

Chepararia_Density_Dry <- data.frame(Grasses_Dry$Species, Density_Grasses_Dry_Chep) print(Chepararia_Density_Dry) colnames(Chepararia_Density_Dry) <- c (“Species”, “Density”)

Chepararia_Density <- merge(Chepararia_Density_Wet, Chepararia_Density_Dry, by = “Species”, all = TRUE, na.rm = TRUE) print(Chepararia_Density) view(Chepararia_Density)