Hey I want to make a visualization of the mean number of children a woman has against the years with a time trend.
I've tried
mean_children_yearly <- aggregate(kids ~ year, fertility, FUN = mean)
plot(mean_children_yearly, xlim=c(2002,2014),
ylim=c(range(mean_children_yearly[,2])))
To get a visualization but cannot seem to add in a trend line Futhermore I tried working with time series
a <- ts(mean_children_yearly)
plot(a)
but that does not put the years on the x-axis. How can I get the years on the x-axis?