# \donttest{
# Load the dataset
data(pangolin_habitat)
# Basic exploration
head(pangolin_habitat)
summary(pangolin_habitat)
# Examine detection rates across habitat types
table(pangolin_habitat$habitat_type, pangolin_habitat$detected)
# Visualize the relationship between termite mounds and pangolin detection
boxplot(termite_mounds ~ detected, data = pangolin_habitat,
main = "Termite Mounds and Pangolin Detection",
xlab = "Pangolin Detected", ylab = "Number of Termite Mounds",
names = c("Not Detected", "Detected"))
# Examine the effect of human disturbance on pangolin detection
boxplot(human_disturbance_index ~ detected, data = pangolin_habitat,
main = "Human Disturbance and Pangolin Detection",
xlab = "Pangolin Detected", ylab = "Human Disturbance Index",
names = c("Not Detected", "Detected"))
# Visualize detection across disturbance levels
barplot(prop.table(table(pangolin_habitat$disturbance_level,
pangolin_habitat$detected), 1)[,2],
main = "Pangolin Detection Rate by Disturbance Level",
xlab = "Disturbance Level", ylab = "Detection Rate")
# }
Run the code above in your browser using DataLab