# \donttest{
# Load the dataset
data(elephant_farmers)
# Basic exploration
head(elephant_farmers)
summary(elephant_farmers)
# Examine distribution of tactics by sex
table(elephant_farmers$subject_sex, elephant_farmers$tactic.season)
# Compare agricultural use metrics across tactics
boxplot(year.mean ~ tactic.season, data = elephant_farmers,
main = "Mean Agricultural Use by Tactic",
ylab = "Mean Agricultural Use")
# Examine tactic changes over time
# Count how many elephants changed tactics vs stayed the same
table(elephant_farmers$tactic.change, useNA = "ifany")
# Look at relationship between distance to agriculture and tactic
boxplot(centroid.dist.meters ~ tactic.season, data = elephant_farmers,
main = "Distance to Agriculture by Tactic",
ylab = "Distance (meters)")
# }
Run the code above in your browser using DataLab