I have this code:
plotfn= function(u) {
flt = filter(d, utensil ==u)
ggplot(flt,aes(x=p)) + geom_histogram(binwidth = 0.5, position= position_dodge(0.5), color="black",fill="cadetblue4")+ ggtitle("Histogram of P")+labs( x="P", y="Number of Observations")
}
lapply(unique(d$utensil),plotfn)
I tried doing a par(mfrow= c(3,3))
to get all 9 plots in 1 screen but it doesn't work. I have to use ggplot.