This is the R code for replicating graphs. The graphs for other tasks are produced in the similar way.
d <- data.frame (X = c(1986:2015,1986:2015,1986:2015,1986:2015),
Y = c(91.6, NA, NA, NA, NA, NA, 86.1, NA, NA, NA, NA, NA,
77.8, NA, NA, NA, NA, NA, NA, 65.1, NA, NA, NA, NA,
66.4, NA, NA, NA, NA, NA,
16.7, NA, NA, NA, NA, NA, 22.1, NA, NA, NA, NA, NA,
27.9, NA, NA, NA, NA, NA, NA, 28.4, NA, NA, NA, NA,
30.5, NA, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, 60.0, 57.7, 55.9, 57.3, 57.6, 54.9,
59.6, 58.7, 59.3, 56.9, 58.3, 62.5, 63.0,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,
NA, NA, NA, NA, 16.8, 17.1, 17.0, 18.9, 17.9, 19.7,
19.3, 21.5, 19.9, 19.4, 22.5, 23.0, 23.2),
group = rep (c("Canadian Women", "Canadian Men",
"American Women", "American Men"), each = 30))
require(ggplot2)
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 3.2.5
require(grid)
## Loading required package: grid
ggplot(data = d[!is.na(d$Y),], aes(x = X, y = Y, group = group) ) +
geom_line() + geom_point(aes(shape=group, fill=group), size=5)+
scale_x_continuous("Year", breaks=seq(1986,2015, by = 4)) +
scale_y_continuous("Time Spent on Cooking, min.", limits = c(0, 100),
breaks=seq(0, 100, by = 10)) +
scale_shape_manual(values=c(24,21,8, 12)) +
scale_fill_manual(values=c("white","black", "white", "black")) +
geom_line(linetype="dotted") +
annotate("text", x=1990, y=5, label="Source: GSS and ATUS") +
theme_bw() +
ggtitle ( "Time Spent on Cooking, Canada and US") +
theme (
plot.title = element_text(face="bold", size=14),
axis.title.x = element_text(face="bold", size=12),
axis.title.y = element_text(face="bold", size=12, angle=90),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.position = c(0.25,0.55),
legend.title = element_blank(),
legend.text = element_text(size=12),
legend.key.size = unit(1.5, "lines"),
legend.key = element_blank())