# \donttest{
# Load the dataset
data(raccoondog_environment)
# Basic exploration
head(raccoondog_environment)
summary(raccoondog_environment)
# Compare raccoon dog detections by season
boxplot(raccoon_dog ~ Season, data = raccoondog_environment,
main = "Raccoon Dog Detections by Season",
ylab = "Number of Detections", xlab = "Season")
# Examine relationship between environmental factors and raccoon dog presence
# Create a binary presence variable
raccoondog_presence <- raccoondog_environment
raccoondog_presence$presence <- ifelse(raccoondog_presence$raccoon_dog > 0, 1, 0)
# Plot relationship with distance to agricultural land
plot(dist_agricultural ~ presence, data = raccoondog_presence,
main = "Raccoon Dog Presence vs. Distance to Agricultural Land",
xlab = "Presence (0=Absent, 1=Present)",
ylab = "Distance to Agricultural Land (m)")
# Examine vegetation types where raccoon dogs were detected
table(raccoondog_presence$Vegetation[raccoondog_presence$presence == 1])
# }
Run the code above in your browser using DataLab