Use <- not = for variable assignment. Old habits die hard.
Plot 2: R code + png