R scripts for the four graphics