# \donttest{
# Load the dataset
data(lion_reproduction)
# Basic exploration
head(lion_reproduction)
summary(lion_reproduction)
# Calculate mean age at first reproduction
mean(lion_reproduction$AFR)
# Compare age at first reproduction by offspring sex
boxplot(AFR ~ OffspringSex, data = lion_reproduction,
main = "Age at First Reproduction by Offspring Sex",
ylab = "Age (years)")
# Relationship between mother's body mass and age at first reproduction
plot(AverageOneYearBodymass ~ AFR, data = lion_reproduction,
main = "Body Mass vs. Age at First Reproduction",
xlab = "Age at First Reproduction (years)",
ylab = "Average Body Mass at One Year (kg)")
# }
Run the code above in your browser using DataLab